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

Access data of frozen columns

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CS
Top achievements
Rank 2
CS asked on 29 Jul 2014, 09:30 AM
I have some columns that are frozen by default, if I try something like $("#grid").data("kendoGrid") I only get the data of all the columns that are not frozen as it seems. How do I get access to the frozen columns?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Jul 2014, 10:51 AM
Hello Stefan,

When frozen columns are used, the Grid data is separated into two tables. So the described problem can occur if you try to retrieve data values via DOM operations. A better option in this case would be to use the Grid API or the Grid DataSource API and retrieve data items as objects.

http://docs.telerik.com/kendo-ui/api/web/grid#methods-dataItem

http://docs.telerik.com/kendo-ui/api/framework/datasource#methods-get
(requires the id to be defined in dataSource > schema > model)

http://docs.telerik.com/kendo-ui/api/framework/datasource#methods-getByUid
(requires you to know the data-uid HTML attribute of the table row)

http://docs.telerik.com/kendo-ui/api/framework/datasource#methods-view

For example: 

1. Open the Grid Frozen Columns demo
http://demos.telerik.com/kendo-ui/grid/frozen-columns

2. Execute the following code in the browser's Javascript console:

var grid = $("#grid").data("kendoGrid"); grid.dataItem(grid.tbody.children().eq(0))


Regards,
Dimo
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
CS
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Share this question
or