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

How do I access the newly added list of data?

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
NHJ
Top achievements
Rank 1
NHJ asked on 17 Dec 2019, 09:09 AM
Hello,

I'm writing logic to add and store some data in an empty grid.

This is fine but I need data information for the rows I added before saving.

Accessing saveChanges () is easy to save, but I need a list of that data.

In summary
Please tell me how to access and use the data before saving the rows I just added with AddRow.

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetomir
Telerik team
answered on 19 Dec 2019, 08:39 AM

Hi Nam,

Whenever a new item is added to the content of the grid, it is added to its data source. The Kendo UI Grid uses the Kendo UI DataSource widget internally, hence, you would be able to access the data of the grid by using the API of the data source. In particular, make use of the data() method:

var data = $("#grid").getKendoGrid().dataSource.data();

More information could be found in the following article:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/data

 

Regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
NHJ
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or