Select all rows feature is not working when adding horizontal scroll

Select all rows feature is not working when adding horizontal scroll

MoizMoiz Posts: 32Questions: 5Answers: 1

Hi,
As you can see in this example -> http://live.datatables.net/wugivuru/1/edit select all checkbox is working perfectly but when I try to add horizontal scrolling by adding scrollX: true then only horizontal scrolling is working like it should be but select all checkbox is not working. Testcase -> http://live.datatables.net/mohexaku/1/edit Please help!

Regards,

Moiz

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,166Questions: 26Answers: 4,921
    Answer ✓

    When using scrollX Datatables clones the header into a new table without rows. It doens't have a na HTML ID for the table. You can see this if you inspect the page. You will need to change your selector for the click event. I changed it from '#tableId' to '.dataTable' in this updated example:
    http://live.datatables.net/mohexaku/2/edit

    Kevin

  • MoizMoiz Posts: 32Questions: 5Answers: 1

    Hello, brother @kthorngren!
    Thank you so much for sharing knowledge and guiding me on the right path. We also need to change #table id to .dataTable in "drawCallback" because when we move to the next page then we don't have to see select all checkbox marked as checked. Solution -> http://live.datatables.net/mohexaku/3/edit . Have a nice day brother Kevin. :)

    Cheers,

    Moiz

This discussion has been closed.