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

isNew() is OK, but isDeleted()?

3 Answers 128 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Oscar
Top achievements
Rank 1
Oscar asked on 22 May 2014, 05:39 PM
Hi Kendo Team,
I'm iterating the collection dataSource.data() and I want to know if a data item of this collection is deleted or not.
There is isNew() method that tells you if the user created a new item, but how can i know if an item of the dataSource was deleted by the user? Is there any IsDeleted() method ?
Something like:
for (var i= 0; i < dataSource.data().length; i++){
   if (!dataSource.data()[i].isDeleted()){  
        // Do whatever
   }
}
Kind regards,
Oscar.

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 23 May 2014, 02:40 PM
Hi Oscar,

There is not isDeleted() property of the dataSource, as the items are directly removed from the dataSource, and no flag is set. The items are completely detached from the dataSource and not methods can be executed on them.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Oscar
Top achievements
Rank 1
answered on 23 May 2014, 02:47 PM
Hi Kiril,
Are you sure? I forgot to say I'm using a grid in batch mode edit and I think deleted rows are actually removed from datasource only when methd sync is executed.

Kind regards.
0
Kiril Nikolov
Telerik team
answered on 26 May 2014, 07:47 AM
Hello Oscar,

You can test this, by searching for the item after you have deleted it. Here is a video that I made, showing it:

http://www.screencast.com/t/bwD453mZrOTB

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Oscar
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Oscar
Top achievements
Rank 1
Share this question
or