Posted 29 March 2018, 5:01 am EST
Hello everyone. Wow, long and interesting thread. Let me try to contribute a little.
The first issue discussed above actually breaks down into two:
-
FlexGrid scroll behavior. I believe this was a bug (IE-specific) which has been fixed in the latest build. So you don’t have to do anything about it other than get the latest version as soon as it is released (probably next week).
-
ODataVirtualCollectionView loading data too often. This one can be fixed in the sample, by debouncing the handling of the scrollPositionChanged event. We have applied this fix to our version of the sample (available soon for download). Here is the change (you can apply this directly to your version of the sample):
// appCtrl.js
// update data window when the grid scrolls
// use a debouncing timeout to avoid too many updates
var setWindowTimeout = null;
flex.scrollPositionChanged.addHandler(function () {
if (setWindowTimeout) {
clearTimeout(setWindowTimeout);
}
setWindowTimeout = setTimeout(function () {
var rng = flex.viewRange;
vcv.setWindow(rng.row, rng.row2);
}, 250); // debouncing timeout
});
The second issue is related to the ODataVirtualCollectionView canceling ‘abandoned’ requests made while the user scrolls the grid and requests a new data window. We have implemented this in the ODataCollectionView class that is part of the wijmo.odata module. It is a nice performance improvement and will be available in the next release as well. Many thanks for the excellent suggestion/request.
Finally, the is a question about “implementing data virtualization for normal flex grids”.
I hope the fiddle below answers this one. It implements a simple and general mechanism for loading data asynchronously and on demand:
http://jsfiddle.net/Wijmo5/bo7trkca/
The data is loaded ansynchronously as the user scrolls the grid. In this example, the data is generated in code. In real applications, it could be calculated or retrieved from a database.
I hope this information is useful.
Thanks again for the great feedback, it really helps us improve our products.