This is a migrated thread and some comments may be shown as answers.

Batch edit data in grid across pages (server side paging) is only sending current page data

2 Answers 247 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 14 Nov 2013, 10:43 PM
I am using MVC Complete v2013.2.918

I am working on supporting batch editing of a column (the percentage column - a decimal value) in the grid across pages when server side paging is used.  I am modeling my modifications based on this example:

When I click the save button (which calls grid.dataSource.sync()), it is currently only sending data for the current page (which is expected and why I'm trying to use something like the linked example above).  The issue now becomes: how can I modify the data sent from the client to the server to contain all the data across all pages instead of just the current page?  I now have the data (thanks to the example above), but don't know how to add it to the data sent to the server.

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Ed
Top achievements
Rank 1
answered on 16 Nov 2013, 10:51 PM
OK, I've got this working - saving the data as it changes in a variable and using that variable to populate an additional param on the AJAX POST that I use instead of the "models" param.  The only issue remaining is: if I'm on a page of data in the grid that doesn't have changes (and other pages do have changes - with those values stored in the global variable), dataSource.sync() doesn't call update.  How can I trick the grid into thinking there is data that needs to be updated in this case?

Thanks,
--Ed
0
Accepted
Alexander Popov
Telerik team
answered on 18 Nov 2013, 01:09 PM
Hi Ed,

You could manually change the dirty flag of the dataItems you want to send, for example:  
grid.dataSource.data()[0].set("dirty", true)
Once you call the sync method every item with dirty flag will be sent to server.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Ed
Top achievements
Rank 1
Answers by
Ed
Top achievements
Rank 1
Alexander Popov
Telerik team
Share this question
or