0
votes

I had this schema in my kendo-ui datasource. Then I had custom button in my kendo grid located at (column > field), so my question how to get an id when I click on that custom button? I try

click: function(e) {
  e.preventDefault();     
  var currentId = $(e.target).closest("venueConfigurationTypeID"); 
  var id = this.dataItem(currentId);
  //var item = this.dataItem.id; <-- return undefined
}

and it return me a null value.

....
schema: {
  model: {
    id: "venueConfigurationTypeID",
    fields: {
      venueConfigurationTypeID      : { editable: false, nullable: true },
      configurationType             : { type: "string", validation: {required: {message: "Value Required"}}},
      configurationTypeDescription  : { type: "string", validation: {required: {message: "Value Required"}}}
    }
  }
},
....
1

1 Answers

0
votes

Find the answer.

click: function(e) {
  e.preventDefault();
  var selection = $(e.target).closest("tr"); 
  var rowData = grid.dataItem(selection);
  var id = rowData.venueConfigurationTypeID;
  console.log(id);
}