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

Virtual scrolling and addRow

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcos
Top achievements
Rank 1
Marcos asked on 21 Jul 2015, 02:37 PM

Hello,

I am currently using a grid with virtual scrolling feature and I would like to add a line to the bottom of the grid. My problem is that even using GridInsertRowPosition.Bottom the line gets added at the bottom of the current "virtual" page. Also, after the lines gets added if I keep scrolling it exits edit mode and my grid will keep an empty line. 

Does anyone know a workaround for this? Even disabling scrolling on the grid during edition will be fine for me as long as the line gets added at the bottom.

 

Thanks in advance,

Marcos

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 22 Jul 2015, 01:06 PM
Hi Marcos,

As documented in our help article "Grid - Appearance", "due to the specifics of its behavior and implementation, the virtual scrolling imposes certain limitations with regard to some other Grid features. It cannot be used together with grouping, hierarchy, keyboard navigation, batch editing and inline editing". 

Although that the PopUp editing is not mentioned, it also requires some workarounds to get it working:

1) After adding a new dataItem to the Grid dataSource, call the sync() method of the dataSource:
2) Subscribe to the sync event of the Grid dataSource, and in the handler, call the read() method of the Grid dataSource. This will refresh the cached dataItem ranges, which now break when a new dataItem is added and cause the scrolling to stop working:

An alternative approach to the above is to add the new dataItem directly to the original dataSource, and call grid.dataSource.read() to load this new item and also refresh the dataItem ranges.

Hope this helps.


Regards,
Konstantin Dikov
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
Marcos
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or