all items in a grid

2 Answers 8731 Views
Grid
Ajeesh
Top achievements
Rank 1
Ajeesh asked on 04 May 2012, 08:26 PM
what could be the best way to get all the models in a grid (including the rows that are not edited)

thanks 
ajeesh

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 07 May 2012, 12:31 PM
Hi Ajeesh,

You could retrieve all the models from the grid's dataSource through the view or data methods. For example:
$("#grid").data("kendoGrid").dataSource.view();
//or
$("#grid").data("kendoGrid").dataSource.data();


Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Nathan
Top achievements
Rank 1
commented on 06 Mar 2018, 03:40 PM

when i run this, the console throws an exception saying that it is undefined, and it appears .data could not have been used in the way it is being used. Am I doing something wrong? Or is there a new change to this?
0
Konstantin Dikov
Telerik team
answered on 08 Mar 2018, 08:07 AM
Hi Nathan,

You need to ensure that you are passing the correct ID of the Grid and that you are getting reference to the Grid`s API:
$("#yourGridID").data("kendoGrid").dataSource.view();


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Ajeesh
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Konstantin Dikov
Telerik team
Share this question
or