deselect() api method does not clear checkboxes when deselecting rows

deselect() api method does not clear checkboxes when deselecting rows

jstuardojstuardo Posts: 104Questions: 41Answers: 0

Hello, I have a datatable with these data:

Upon some condition, this api method is called:

table.rows({ selected: true }).deselect();

After that, this is the actual result:

Why is only the first checkbox cleared and not the others?

How can I solve it?

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,597Questions: 1Answers: 10,485 Site admin
    Answer ✓

    It appears to work okay here: https://live.datatables.net/mefafegu/1/edit .

    Can you make sure you are using the latest versions of DataTables and Select please? If that doesn't resolve it, then please link to a test case showing the issue so I can debug it.

    Allan

  • jstuardojstuardo Posts: 104Questions: 41Answers: 0

    Thanks Allan.

    It turned out I was not using select plugin, so I compared your example with mine and now it works. I have also updated datatable, however, please look how the footer is shown:

    The summary shown is very long. It says "Showing 1 of 7 records 2 rows selected 0 columns selected 0 cells selected"

    If I select only 1 row, this is shown ("1" with letters):

    "Showing 1 of 7 records One row selected 0 columns selected 0 cells selected"

    I only need to be shown "Showing 1 of 7 records 1 row selected"

    How can I fix that side effect? with previous version, that problem did not occured.

    Thanks
    Jaime

  • allanallan Posts: 63,597Questions: 1Answers: 10,485 Site admin

    Hi Jamie,

    Have you got language.select.columns and language.select.cells set somewhere?

    You want the 0 option for them to be an empty string (see the second example on their documentation pages).

    Allan

Sign In or Register to comment.