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

Get ID of row clicked

1 Answer 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
3PL
Top achievements
Rank 1
3PL asked on 15 Jan 2016, 12:05 AM

So the objective here, is if a row is selected and then that row is clicked, it would deselect it so no row would be selected.  The standard way would be to use the change event

 change: function(e) {
var selectedRows = this.select();



},

 

So would some way to set an ID of the row that is single selected at first, so when a click happens later on you can see if it is the same row and if it is you hide that selection

1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 15 Jan 2016, 12:33 PM
Hello Kevin,

You can get the selected items as illustrated in the example below.


If you would like to deselect a row you can remove the k-state-selected class for it.


$(rowToDeselect).removeClass("k-state-selected");



Regards,
Viktor Tachev
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
3PL
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or