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

select first row in a grouped grid

1 Answer 246 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 27 Feb 2014, 10:31 AM
So I have a kendo Grid and a datasource populated by an ajax call.

the grid has groupable set to true. 
when someone groups by a column I'd like to automatically select the first row in the first group.   I also have a button somewhere outside the group which needs to do the same this.

I am basically trying to make sure the first row in the grid is selected whatever the user is doing, group or not.

grid.table.find('tr:first'); this line correctly identifies the first row BEFORE any group is added but if I try that after the grouping is done it will simply return the first group's header and it's not what I need.

How can I achieve this?

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 27 Feb 2014, 11:07 AM
Hi Stuart,


To assure that the retrieved row is an actual grid item row, you could add an attribute selector by role='row'.
E.g.
grid.tbody.find("tr[role='row']:first")

Regards,
Dimiter Madjarov
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
Shaun
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or