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

Grid Batch Editing with Virtual Scrolling

0 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 09 Feb 2014, 12:46 AM
**** I WAS INCORRECT IN MY ASSUMPTION THAT DATA WAS LOST WHILE SCROLLING.  PLEASE DISCARD THIS POST.

I have a grid in cell editing mode with virtual scrolling with a dataSource using batch updates.  When the virtual scrolling requires new data to be fetched from the server, any unsaved changes to the current data are lost.  That makes sense because the dataSource is only maintaining a portion of the total data at any given scroll position.

I would like to present the use with a message like "You need to save changes before scrolling any more..." and give them the opportunity to either save or cancel the existing changes or simply stop the scrolling until the either save or cancel.

I tried binding to the requestStart event that is triggered by the dataSource's undocumented prefetch method that is called while virtual scrolling.  I can prevent the new data from being fetched by calling event.preventDefault() in the handler but the grid is left in a disabled state via a kendo progress indicator that was initiated somewhere along the way.

The relevant code in kendo-ui that I've been examining include VirtualScrollable._scroll() and DataSource.prefetch().

Q: Is there a more elegant way of doing this?  I know I could use paging and have more control but virtual scrolling is just much cooler IMO.

Thanks

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Share this question
or