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

Fire itemchange on dataSource.insert

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CS
Top achievements
Rank 2
CS asked on 24 Jul 2014, 02:28 PM
It seems like the event.action "add" is a bit different from the "itemchange". The "itemchange" event does what it should do but the "add" only inserts the values and the change routine is not fired, is there a way to fire the "itemchange" after an "add" to update the row ?

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 28 Jul 2014, 07:27 AM
Hi Stefan,

I am not sure I understand your question correctly. Basically, the change event is triggered on "add" as well and you can get the item and modify it. For example: 
dataSource = new kendo.data.DataSource({
  change: function(e){
    if(e.action == "add"){
      e.items[0].set("ProductName", "TEST");
    }
  },

Please, let me know if I am missing something.

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