Posted 6 March 2018, 2:11 am EST
Abhishek,
I already use this approach - the scrollbar is blinking - your example is not reflecting my problem:
take look on my code. It remembers position right before vcv.setWindow and then reverts it immediately. But the same result is without using it:
initODataVirtualCollectionView (s: wjcGrid.FlexGrid) {
// declare virtual collection view
let vcv = new wjcOData.ODataVirtualCollectionView(
"http://services.odata.org/V4/Northwind/Northwind.svc",
"Order_Details_Extendeds", {
oDataVersion: 4
});
// use virtual collection as grid data source
let flex = s;
flex.itemsSource = vcv;
// update data window when the grid scrolls
flex.scrollPositionChanged.addHandler(function () {
let rng = flex.viewRange;
let pos = flex.scrollPosition;
console.log('1-',pos, flex.scrollPosition);
vcv.setWindow(rng.row, rng.row2);
console.log('2-',pos, flex.scrollPosition);
flex.scrollPosition = Object.assign({}, pos);
console.log('3-',pos, flex.scrollPosition);
});
// show row indices in row header cells
flex.formatItem.addHandler((_s, e: any) => {
if (e.panel.cellType === wjcGrid.CellType.RowHeader) {
e.cell.textContent = e.row;
}
})
// add a filter
let filter = new wjcGridFilter.FlexGridFilter(flex);
}
This is probable specific to angular2. Please see included video and note thescrollbar changing its position right after data is loaded