How to delete all record from DataSource without looping?

3 posts, 0 answers
  1. Ambica
    Ambica avatar
    6 posts
    Member since:
    Dec 2012

    Posted 15 Mar 2013 Link to this post

    Hi all,

    I am wondering is there any method to remove all record from dataSource ? and then sync(), so that it'll clear all record from DB .

    Have scenario like i want to delete 500 records then add 20 - 30 records. I can do it with loop it causing delay. 

    Please help me out

    Thanks in Advance
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 18 Mar 2013 Link to this post

    Hello Ambica,

     Currently the Kendo DataSource doesn't provide any API fore deleting all records. Looping is the only supported way.

    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Brett
    Brett avatar
    25 posts
    Member since:
    Sep 2012

    Posted 22 Mar 2013 Link to this post

    You could set the DataSource batch mode to true. That way all of your deleted records are sent in one request to the server. And then all of your added records are sent in a separate request to the server. Then on the server-side you would have to loop through each record to add/remove them from your data store. The benefit here is that the looping is done on the server, and since the requests are asynchronous, the client is not held up.
Back to Top