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

Get row dataitem of Details Grid in dropdownlist change event

2 Answers 3025 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roy
Top achievements
Rank 1
Roy asked on 29 Aug 2017, 09:20 AM

Hi,

hope it's an easy one....

I have i DropDownList column in the details grid (hierarchy grid).
I want to get the row dataitem when a change event on the dropdownlist occurs.

How can achieve that?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Preslav
Telerik team
answered on 29 Aug 2017, 03:14 PM
Hi Roy,

Achieving the desired behavior will require the usage of the jQuery closest and the Grid dataItem methods.
For example, the change event handler function could look like:

function onChange(e){
  var grid = e.sender.element.closest(".k-grid").data("kendoGrid");
  var row = e.sender.element.closest("tr");
  var dataItem = grid.dataItem(row);
   
  console.log(dataItem);   
};

For a runnable example, check this Dojo:
Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Roy
Top achievements
Rank 1
answered on 29 Aug 2017, 03:24 PM
That will do the job...

Thank You!!
Tags
Grid
Asked by
Roy
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Roy
Top achievements
Rank 1
Share this question
or