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

How can I get the grids model from a custom column editor?

1 Answer 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gregory
Top achievements
Rank 1
Gregory asked on 03 Apr 2017, 10:43 PM

Hi, anyone know how can I get my grid's current row being edited?  I would do this from an event for a custom column editor. The whole idea is that I have a grid with inline editing and use an autocomplete editor template. During the autocomplete's select event I want to populate multiple fields of my grid's row. I can't seem to get a reference to the grids row.  All the examples I see say to use the 'select()' method, but my grid has row selection disabled (on purpose). Here is an example of a snippet that doesn't work:

var grid = $('#mygrid').data('kendoGrid');
var selectedItem = grid.dataItem(grid.select());

 

Any suggestions would be greatly appreciated!

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 05 Apr 2017, 09:54 AM
Hello Gregory,

The desired result can be achieved using the edit event of the Grid, as in 'inline' edit mode, it will return the currently edited row. Then that row can be saved in a variable, and the variable used in the dataItem method:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-edit

Please check the following example demonstrating this:

http://dojo.telerik.com/elAkO

I hope this is helpful.

Regards,
Stefan
Telerik by Progress
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 (charts) and form elements.
Tags
Grid
Asked by
Gregory
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or