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

Create and Destroy Event

1 Answer 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chatra
Top achievements
Rank 1
Chatra asked on 22 May 2014, 06:58 AM
Hi,

I want to do some more action while create and destroy event  call with the default functionality of the events. In the demo not able to call the destroy function call. 

Here is what  i am trying achieve.

1) when we destroy or remove a item from grid .The item should be removed from the grid and corresponding Name field in data item should get added to the Top Drop down list.
2)And when we select a item from dropdown list and click Add/Create button ,the selected data item in the dropdown list need to pushed into grid and corresponding selected item from Drop down should be removed from Drop down list.And similarly the dataitem which is added to grid can be removed by destroy button ;which makes this Data item pushed back to Drop down list.

Thanks
Chatrapathi Chennam

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 26 May 2014, 08:23 AM
Hello Chatrapathi,

This could be achieved by subscribing to the Grid's remove event. Once the event is triggered you can get the deleted item and add it to the DropDownList's dataSource. You can also subscribe for the change event of the Grid's DataSource. Once it is triggered you can check if item is being added and based on that remove the equivalent item from the DropDownList. For example: 
dataSource = new kendo.data.DataSource({
    change: function(e){
      if(e.action == "add"){
        ...
      }
},


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
Chatra
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or