Select All Row functionality call multiple times while updating the table

Select All Row functionality call multiple times while updating the table

RupeshVRupeshV Posts: 1Questions: 1Answers: 0

On table redraw multiple row selection events are fired when row in table is selected.

Scenario

We have table created with checkbox selection as https://datatables.net/extensions/select/examples/initialisation/checkbox.html.

We have added custom checkbox in first row and first column to select all rows in table when clicked.

We need to refresh this table based on new data.

Case 1:
After table is refreshed when user selects single row in table then multiple selection events are fired.
 
Case 2:
If table is refreshed multiple times and then user clicks on single row in table then the number of times table is refreshed that many times selection events are fired.

Answers

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954

    Without seeing your code its hard to say. My first thought is that your code is creating the event handler inside the function that is refreshing the table. So each time its called an additional event handler is created with each created handler running when there is a select event.

    If you still need help then please post a link to your page or a test case replicating the issues so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.