How do I access the (model) values of a selected row using the new 2012 Kendo UI Web? I.e. in the change event of a Kendo grid.
Where do I find more resources on this topic and also on models in the 2012 version? I haven't found the answers in the datasource or grid documentation/demos sections.
2 Answers, 1 is accepted
0
Accepted
Rosen
Telerik team
answered on 27 Apr 2012, 02:13 PM
Hello Bjarke,
The easiest way to get reference to the data record assign to given grid data row is by using dataItem method. For example:
var grid = $("#grid").data("kendoGrid");
grid.bind("change", function() {
//if grid single row selection is enabled
var model = grid.dataItem(grid.select());
//get the value of the foo field
console.log("value of foo is ", model.foo);
});
Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!