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

Saving changes to grid without remote data source

2 Answers 218 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 31 Jul 2015, 07:54 PM

How are the changes to a grid stored prior to updating the underlying datasource?

I have a grid that I am building by building a JSON String and setting data = data: [ "column": "data", "column2": true ].

This grid holds several items for configuring another grid.  The part I'm trying to figure out right now is once I make a change to this grid, (I have a few template columns that hold the data), how do I save those changes?

I know I can use $('#myGrid').data().kendoGrid.dataSource.view() to get the data, but this doesn't contain the updates that were made since the data was bound to the grid.

 

Ideally, I'd like the user to be able to freely edit the grid (check boxes and enter text) and then click a save button.  Then I'd like them to be able to click a "refresh" button, that would export the updated grid to a JSON string.

2 Answers, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 31 Jul 2015, 08:00 PM
Ok.  The View() function works to get the data, but apparently if I try to stringify the results of the view() function, then it changes the values back to default for some reason.
0
Boyan Dimitrov
Telerik team
answered on 04 Aug 2015, 03:24 PM

Hello Matt,

Actually I am not able to understand the exact problem you are facing. Could you please explain what edit mode of the Grid you are using? 

Generally speaking updates made to the data item/items in edit mode should be applied to the data source. Please refer to Kendo UI Grid demos and specifically the demos related to the editing functionality. 

The data source view method returns the data items which correspond to the current page, filter, sort and group configuration.The data method returns the entire data for the data source. 

Regards,
Boyan Dimitrov
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
Matt
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or