Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining which field was changed in a grid

Tags:

kendo-ui

Is it possible to identify on a kendo UI grid which field was altered on a row edit?

Right now I am sending the entire row to the server that was changed. I would like to send the request to the server to also include a variable holding the name of the field that was edited.

  1. Is something like that supported by kendo or
  2. is there a work around for that?
like image 987
Stephan Avatar asked Dec 20 '12 11:12

Stephan


1 Answers

This is not supported out of the box. However the grid API should allow this to be implemented. Check the edit and save events. In there you can listen to changes of the model instance which is currently being edit. Here is a quick example:

$("#grid").kendoGrid({
   edit: function(e) {
     e.model.unbind("change", model_change).bind("change", model_change);
   }
});

function model_change(e) {
  var model = this;
  var field = e.field;
  // store somewhere the field and model
}
like image 137
Atanas Korchev Avatar answered Sep 30 '22 16:09

Atanas Korchev