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

Getting the selected row data on Grid Change event

3 Answers 5809 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Atanu
Top achievements
Rank 1
Atanu asked on 15 Oct 2012, 09:24 AM
Hi

How to get the selected row data on Change event of the Kendo Gridd as follows

.Events(events => events.Change("Grid_OnRowSelectUID"))

I used to get that in Telerik grid by using the following

Grid_OnRowSelectUID = function (e) {
    var row = e.row;
    RowSelectUid = row.firstChild.innerText;
}

But somehow the parameter 'e' is not same in case of Kendo UI.

Also the below statement  is also not working inside the above function which used to work with Telerik grid.

var grid = $(this).data("kendoGrid")

Please advise where I am going wrong.

3 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 16 Oct 2012, 03:36 PM
Hi Atanu,

 
Please note that the event object contains the Grid client object, and if you need to get the currently selected row data item you should use the dataItem method of the Grid:

function onChange(e) {
    grid = e.sender;
    var currentDataItem = grid.dataItem(this.select());
}
Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Luis
Top achievements
Rank 1
answered on 17 Feb 2015, 04:44 PM
Hi, I'm getting the following error:
Object doesn't support property or method 'select' using the code above.
And I'm getting the same error using the code from the demo's page:
var selected = $.map(this.select(), function (item) {
    return $(item).text();
});
0
Vladimir Iliev
Telerik team
answered on 18 Feb 2015, 06:26 AM
Hi Luis,

I tried to reproduce the described behavior on our side but to no avail - everything is working as expected. Could you please submit new support ticket or forum post and provide runable example where the issue is reproduced? This would help us identify the exact reason for current behavior. 

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Atanu
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Luis
Top achievements
Rank 1
Share this question
or