How to get the grid's rows count ?My grid has data,but the code shows 0 row..
alert($('#Grid').data("kendoGrid").tbody.find('>tr.k-master-row').length);
3 Answers, 1 is accepted
0
Dimiter Madjarov
Telerik team
answered on 10 Apr 2013, 07:29 AM
Hi Peiyang,
The provided code seems correct for getting the count of the master rows in the Grid.
E.g.
var grid = $("#grid").data("kendoGrid");
var masterRowsCount = grid.tbody.find('>tr.k-master-row').length;
This code should be executed after the Grid has bounded the data. You might receive 0 if you are calling it before that.
Greetings,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
var grid = $("#grid").data("kendoGrid");
var masterRowsCount = grid.tbody.find('>tr.k-master-row').length;
0
Dimiter Madjarov
Telerik team
answered on 12 May 2016, 07:37 AM
Hello hiroshi,
Are you experiencing an issue with the provided sample code?
Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items