Preserving checkbox states on form submission when paginating
Preserving checkbox states on form submission when paginating
gabrielmansour
Posts: 1Questions: 0Answers: 0
Hi,
I have a form that contains a DataTable of items I want to select, and each item (row) as an associated checkbox. (The table is generated on the server-side.)
However, I've noticed that when I select items and then navigate to another page of the table, those previous selections are not preserved upon form submission.
Steps to reproduce:
1. Go to http://live.datatables.net/uconid/5/edit
2. Select some items on the first page.
3. Click "Next" and select an item on that page.
4. Click the submit button.
Expected behaviour:
The form should submit all of the selected items on every page.
Actual behaviour:
The form only submit values for the currently visible view.
I am using DataTables 1.9.2.
(From what I can tell, DataTables is removing the old table row nodes from the DOM and appending new ones each time it redraws upon pagination. If I can figure out a way have all of the rows initially loaded into the DOM, and then show and hide the rows using CSS, this would solve this problem.)
Any help with this would be greatly appreciated.
I have a form that contains a DataTable of items I want to select, and each item (row) as an associated checkbox. (The table is generated on the server-side.)
However, I've noticed that when I select items and then navigate to another page of the table, those previous selections are not preserved upon form submission.
Steps to reproduce:
1. Go to http://live.datatables.net/uconid/5/edit
2. Select some items on the first page.
3. Click "Next" and select an item on that page.
4. Click the submit button.
Expected behaviour:
The form should submit all of the selected items on every page.
Actual behaviour:
The form only submit values for the currently visible view.
I am using DataTables 1.9.2.
(From what I can tell, DataTables is removing the old table row nodes from the DOM and appending new ones each time it redraws upon pagination. If I can figure out a way have all of the rows initially loaded into the DOM, and then show and hide the rows using CSS, this would solve this problem.)
Any help with this would be greatly appreciated.
This discussion has been closed.
Replies
Steph