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

Kendo UI Grid not firing destroy or add events

1 Answer 584 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 11 Apr 2012, 05:28 PM
Hi, I'm using the kendo UI grid without using the dataprovider(including the transport object) because we are using server sides pushed data.

All I want to do is when i click delete on the grid, or add, catch that event and do some stuff.

however I can't get the listener to kick off. Iv'e tried 2 methods outlined in the docs, but I think its because i'm not using the data provider?

$("#grid").kendoGrid({
               columns: [
               "Id",
               "HostName",
               "BaseUri",
               { field: null,command: "destroy"}
               ], 
               editable: true,
               remove: function(row) {alert("removed");}
           });
and 
$("#grid").kendoGrid({
     remove
: function(e) {
         
// handle event
 
});
have not been working for me

This is how i'm refreshing the data
$("#grid").data("kendoGrid").dataSource.data(message).read();

I also had the same issue using the toolbar[] to define the destroy button.

Looking at my console it looks like its trying to call destroy in the data provider but again i'm not using that 

  1. h.extend._modelForContainerkendo.all.min.js:11
  2. h.extend.removeRow <- there's the event i'm trying to catchkendo.all.min.js:11
  3. h.extend._editablekendo.all.min.js:11
  4. f.event.dispatchjquery.min.js:3
  5. f.event.add.h.handle.i

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 13 Apr 2012, 02:56 PM
Hello Andrew,

I was not able to reproduce the problem using this jsFiddle example. Could you please check it and show me what I am missing?
 As a general information, there is no need to call the read method of the dataSource after the data has been changed. The changes will take place automatically.

Regarding to the last problem, I am afraid that the "Destroy" command is not supported in the toolbar, this functionality is available only as a column control.

Kind regards,
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
Andrew
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or