Checkboxes in Datatable column, with Ajax

Checkboxes in Datatable column, with Ajax

veloopityveloopity Posts: 87Questions: 36Answers: 2

Here is something special. The first column of my datatable contains checkboxes (enabling users to select rows). (The checkboxes contain an alphanumeric value and carry an id to identify each of them. I also keep the checked IDs in a hidden form field which gets updated every time someone checks or unchecks a checkbox.)
This worked well in a traditional datatable with pagination - checked checkboxes stayed checked even after paging back and forth. With Ajax functionality added (which works well otherwise), the checkboxes are generated on the server, along with all other data, and the server doesn't know if they were checked. So after paging, they are always unchecked. I imagine I need a function that re-checks them (based on that hidden form field) after the page is retrieved from Ajax and gets displayed but I don't know where to put such a function and how to call it. Ideas anyone, or examples? (I know nothing about jQuery.)

Answers

Sign In or Register to comment.