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

Grid - Popup Editing, Select Row

1 Answer 612 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 02 Apr 2012, 04:17 PM
I am using the Popup editing in the UI Grid.  How can I select the data values for the Row that is currently being edited?  I need to grab the country for the current row and send it as a parameter to a datasource to return the states for that country.

I am doing this to select the first row, is there a style applied to the row that is currently selected or edited?

 var grid = $("#entityAddressGrid").data("kendoGrid");

             console.log(grid);

             var dataItem = grid.dataItem(grid.tbody.find(">tr:first"));

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 04 Apr 2012, 11:29 AM
Hello Curt,

I suggest using the edit event parameter to retrieve the model that is being editing. For example:
//grid configuration
edit: function(e) {
    var model = e.model; //gets the model of the currently edited row
    var country = model.country; //gets the value of the field "country"
}

I hope this approach will fit in your scenario.

All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Curt
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or