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

How to get the destroyed data items from the Grid's dataSource

3 Answers 8 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Veteran
Iron
Chris asked on 08 Aug 2018, 08:22 AM




 

 

 

 

 

 

 

HI

Everyone always ask how to delete the record,
But my question is : 

How to get the destroyed data items from the Grid's dataSource ?
Is there have any official/public method or property ? 

Best regards

Chris

 

 

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 09 Aug 2018, 10:45 AM
Hello Chris,

By default the deleted items would be returned back to the client so the Grid is updated correctly. If you would like to retrieve the items there I would suggest handling the requestEnd event for the DataSource. Then check the type of the request and if it is "delete" get the items from the e.response argument.

The relevant logic would look similar to the following:

function onRequestEnd(e) {
    if (e.type == "destroy") {
        var deletedItems = e.response;
    }
}

Let me know how this approach works for you.

Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chris
Top achievements
Rank 1
Veteran
Iron
answered on 09 Aug 2018, 02:00 PM

Thanks for your response but I want to get the destroyed data items from the Grid's dataSource just simple Button click event (without any data request).

Best regards

Chris

 

0
Alex Hajigeorgieva
Telerik team
answered on 13 Aug 2018, 11:10 AM
Hello, Chris,

My name is Alex and I am filling in for my colleague Viktor while he is away.

It is possible to get the destroyed dataItems without making a request by using the internal dataSource method destroyed():

var destroyedDataItems = grid.dataSource.destroyed();

Here is a runnable example for your convenience:

https://dojo.telerik.com/@bubblemaster/ICERimig

As always, be cautious about using methods/properties which are not part of the public API as these are subject to change.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Veteran
Iron
Answers by
Viktor Tachev
Telerik team
Chris
Top achievements
Rank 1
Veteran
Iron
Alex Hajigeorgieva
Telerik team
Share this question
or