This topic contains 10 replies, has 2 voices, and was last updated by Jai Jai 4 days ago.

Metronic DataTable – datatable.setActiveAll(active) problem


  • willaguilar
    Participant

    Posts: 34
    Member Reply #17690

    I have a DataTable which is getting its data from an ajax source. I have implemented an “Enable/Disable” functionality via the record selection. Everything works ok.

    Here is the problem, I’m enabling/disabling my records via ajax. When ajax finishes two things happen….

    datatable.setActiveAll(false)
    datatable.reload()

    Unselecting all the rows get executed. However, when the reload() functions finishes the rows that I selected originally get selected again.

    • This topic was modified 1 month, 1 week ago by  willaguilar.

    willaguilar
    Participant

    Posts: 34
    Member Reply #17693

    any fix?

    Jai
    Jai
    Keymaster

    Posts: 2292
    Support Staff Reply #17702

    Hi 🙂

    Thanks for your feedback.

    We will check it and provide the fix.

    Thanks


    willaguilar
    Participant

    Posts: 34
    Member Reply #17768

    Is this a bug then? Any estimate time on fix. It’s a major bug for me, specially when deleting records. The hidden menu never goes a way since it thinks a record is selected.

    Jai
    Jai
    Keymaster

    Posts: 2292
    Support Staff Reply #17780

    Hi 🙂

    No estimation time yet. But we will give the fix patch here before it releases.

    Thanks


    willaguilar
    Participant

    Posts: 34
    Member Reply #18158

    Hello, according to the new release changelog you guys fixed this issue. However, I can confirm this bug still exists and hasn’t been fixed

    Jai
    Jai
    Keymaster

    Posts: 2292
    Support Staff Reply #18174

    Hi 🙂

    Can you try to enable the checkbox extension? Please check this sample code.

    /src/js/demo/default/custom/crud/metronic-datatable/base/record-selection.js

    Thanks


    willaguilar
    Participant

    Posts: 34
    Member Reply #18196

    Hello Jai, the extension is enabled. The current problem is that the records never get deselected. I have added two pictures showing this behavior

    Attachments:
    You must be logged in to view attached files.
    Jai
    Jai
    Keymaster

    Posts: 2292
    Support Staff Reply #18210

    Hi 🙂

    The quick fix is you can try to remove it from the datatable variable.

    datatable.checkbox.selectedAllRows = false;
    datatable.checkbox.selectedRows = [];

    Thanks


    willaguilar
    Participant

    Posts: 34
    Member Reply #18276

    Hello Jai,

    I tried your snippet and it didn’t work.

    Jai
    Jai
    Keymaster

    Posts: 2292
    Support Staff Reply #18327

    Hi 🙂

    We will fix it in the code then. We will release the quick next updates in a few days more.

    Thanks

Tagged: 

You must be logged in to reply to this topic.