Check box issue with pagination change

Check box issue with pagination change

p_prnmp_prnm Posts: 5Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Hi Allan,

I have added a check box for each row in the table and there is another check box in the table header. On click of which all the check boxes will be selected. This functionality is working. But when I navigate to the second page and click on the table header check box to all the rows in the table. The results in the first page are displaying first. When I navigate to the second page, I can see all the rows selected. I'm not getting why this is happening like this.

Link page: http://live.datatables.net/izewiy/5/edit#source

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    It is because a sort is being performed. You want to cancel the bubbling event by listening for the click on the 'select all' checkbox and using preventPropagation().

    Allan
  • p_prnmp_prnm Posts: 5Questions: 0Answers: 0
    Thank you for the reply Allan, it is working great.
    But I have a small problem here.
    When I click on the "select all" checkbox in the second page now it is not coming to the first page. But when I navigate to first page, the selected check box is still showing as checked. how should I handle this on page navigation.
    Link page: http://live.datatables.net/izewiy/8/edit#source
  • p_prnmp_prnm Posts: 5Questions: 0Answers: 0
    Hi Allan,

    It would be really great if you can help us with this issue.
This discussion has been closed.