Jeffrey Lott
Jeffrey Lott

Reputation: 7419

How do I return all of the rows in a JQuery Datatable to my server-side code

In my cshtml file, I've built out a table with rows data that the users can edit. Right now, there are about 25 rows of data, but I expect that to keep growing. To help keep the UI clean, I've added JQuery DataTable to the page enable sorting, filtering, and paging. I thought everything was working fine until I realized that I was only getting the visible rows returned to the server.

I fired up Fiddler, and verified that only the visible rows were being passed along as the Form Data. I need every row to be returned so that the users can edit multiple rows on different pages without needing to save every time they want to change which rows are visible. How can I accomplish this?

Upvotes: 0

Views: 295

Answers (1)

Vaibhav Sharma
Vaibhav Sharma

Reputation: 98

You should create an global array an put all your datatable objects. Than on page postback just iterate through the array and use datatable in built function to destroy viz. fnDestroy. I was having same problem. I catched all page postbacks on masterpage and destroyed all found datatable objects using above method.

Upvotes: 1

Related Questions