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

Client-side Kendo Grid Paging with In-Line Editing

3 Answers 275 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Beth
Top achievements
Rank 1
Beth asked on 07 Aug 2013, 05:51 PM
Kendo Version 2013.2.716
Kendo MVC Wrappers 

I currently have a grid that has InLine editing enabled, and also makes use of a pager whose ServerOperation is set to false (meaning all the sorting, paging, etc happens client side rather than re-poll the server).

When creating a new record InLine, if the user selects another page in the pager (without actually saving the new record first), and then returns to the original page that the new record had been inserted, it displays an empty row as though it had been saved.

 I have tried looking into the DataBound event, but I cant find any indicator on that event that tells me whether it is as a result of a page action, a filter action, etc.  Clearing the edit mode in the DataBound event interrupts the Create or Edit functions, as those also trigger DataBound.  


The question is:  is there a way to instruct the grid to clear the edit mode any changes when the pager or filter options are used and not insert an empty row?

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 09 Aug 2013, 03:12 PM
Hello Sarah,

Could you please try to use the change event of the dataSource and invoke the dataSource.cancelChanges() of the Grid's dataSource? Arguments of the events expose a field called action which describes the type of operation that just happened.

I hope this event/methods helps you resolve the case.

Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Beth
Top achievements
Rank 1
answered on 17 Oct 2013, 12:18 PM
Unfortunately, this doesn't help.  The action field on the event object does not always contain a value, remaining undefined for a good number of the scenarios, including  when the grid is populating its data (as a result of DataBound).  

When it does contain a value, it is simply "add", "remove" (and I think "edit").   I need to be able to zero in specifically on a page change event/action to instruct the grid to cancel the change mode.
0
Petur Subev
Telerik team
answered on 21 Oct 2013, 08:02 AM
Hello again Sarah,

Unfortunately I cannot offer you other work around other than hooking event to the Grid pager container.

$('#grid').data().kendoGrid.pager.element.on('click',function(){...})

However this wont be applicable when the Grid is sorted, grouped or filtered. Kind Regards,
Petur Subev
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
Beth
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Beth
Top achievements
Rank 1
Share this question
or