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

Selecting a grid row using API isn't working

3 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
OMER
Top achievements
Rank 1
OMER asked on 06 Mar 2014, 11:32 AM
Hi,
I have a simple grid and I'm using the script shown in the documentation.
var grid = $("#grid").data("kendoGrid");
grid.select("tr:eq(1), tr:eq(2)");
In my code, I have this in my grid's options:
dataBound: function (e){
                                      console.log(e.sender);
                                      if (e.sender.dataSource && e.sender.dataSource.data().length>4){
                                        this.select("tr:eq(1)");
                                      }
It gives me an error:
TypeError: Object [object Object] has no method 'selected'
What am I missing?
Thanks

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 06 Mar 2014, 11:41 AM
Hi Omer,


The provided sample code seems correct. Could you please send me the full source code for the Grid implementation, so I could inspect it further?

I am looking forward to hearing from you.

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
OMER
Top achievements
Rank 1
answered on 06 Mar 2014, 05:02 PM
Here is my code:
http://plnkr.co/edit/eTRgf4BrP2iP7Pm0J9TO
0
Dimiter Madjarov
Telerik team
answered on 10 Mar 2014, 10:01 AM
Hello Omer,


I did not found where the selection code from the previous ticket is executing. Nevertheless since the current Grid is constantly reloading it's data, this will cause the previous selection (before the reload) to be lost. If maintaining the selection is required, you should implement some custom solution in order to achieve this.

I would also like to state that the Angular JS integration for Kendo UI is not an official part of Kendo UI and we could not provide any specific help regarding it.

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