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

Maintaining pending changes when using ServerPaging

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 12 Apr 2013, 08:38 PM
Is there a way to maintain the pending changes on the grid when using ServerPaging, ServerGrouping, ServerFiltering, ServerSorting and ServerAggregates?  We're losing all pending changes whenever a filter is applied, page is changed, column sorted, etc.  Should these changes be preserved by default or is there something we can do to preserve them?  At a minimum, is there something we can do to detect these actions and prompt the user to commit the changes before filtering, paging, etc?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 16 Apr 2013, 10:59 AM
Hello Ryan,

I am afraid that Kendo Grid does not provide a build-in functionality for maintaining the pending changes in case server side operations are turned on.

As a workaround, I suggest you to use the hasChanges method of the DataSource to detect whether there are any pending changes. You may hook up to the requestStart event which will fire every time when server operation is issued and warn the user if there are unsaved changes. Current operation can be cancelled via e.preventDefault()

requestStart: function (e) {
    if(this.hasChanges()) {
        e.preventDefault();
        //warn the user
    }
}

I hope this will help.

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