This topic contains 3 replies, has 3 voices, and was last updated by  galobart 1 week, 5 days ago.

[BUG] Bad count on selected rows from locked table


  • kanak09
    Participant

    Posts: 24
    Member Reply #13835

    Hello,

    Unless there is a specific method for that, I think I found another bug on locked Datatable… When using locked table (both locked on my case) with row select box, there is a bad count, direct consequence of a problem in the row selection action : the “m-datatable__row–active” class are sometimes on the 3 blocks of a same row (m-datatable__lock–left, m-datatable__lock–scroll, m-datatable__lock–right), and sometimes not.

     

    HOW TO REPRODUCE :

    1. go to http://keenthemes.com/metronic/preview/?page=components/datatables/locked/both&demo=default
    2. open developer console
    3. check a row
    4. test this code

      var checkedNodes = $(‘.m_datatable’).mDatatable().rows(‘.m-datatable__row–active’).nodes();
      checkedNodes.length;

    5. it should  display 3, whereas only one row is selected
    6. then go to the right lock only : http://keenthemes.com/metronic/preview/?page=components/datatables/locked/right&demo=default
    7. check a row
    8. test the same javascript code
    9. it should display 2 whereas only one row is selected

     

    Honestly I find myself very disapointed since I bought this template on version 5, either there are bugs, or there the feature is not developed yet whereas it was on the v4. I mean, we buy 50$ a template that in fact looks more like a beta version than a stable release.

    Waiting for your feedback.

    Regards

     

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

    Posts: 2715
    Support Staff Reply #13855

    Hi 🙂

    Thanks for your feedback. We will check it and fix the bug.

    Since v5.x is 100% rewrite from v4, we need some time to reintegrate all the theme features back like the v4. We are constantly updating the theme to follow up the v4.

    Thanks


    galobart
    Participant

    Posts: 2
    Member Reply #20027

    var checkedNodes = datatable.rows(‘.kt-datatable__row–active’).nodes();

    var count = 0;

    for (var i = 0; i < checkedNodes.length; i++) {

    if (checkedNodes[i].parentNode.className === “kt-datatable__body”)

    count++;

    }


    galobart
    Participant

    Posts: 2
    Member Reply #20048

    Sorry, the previous code was wrong. This is the right one:

     

    var checkedNodes = datatable.rows(‘.kt-datatable__row–active’).nodes();

    var count = 0;

    for (var i = 0; i < checkedNodes.length; i++) {

    if (checkedNodes[i].parentNode.classList.contains(“kt-datatable__body”))

    count++;

    }

You must be logged in to reply to this topic.