Hi,
We observe an issue that the vertical scroll bar is shift automatically after we restore the scroll bar position after data updates in dataArrived.
Basically, we store the scroll bar position before data fetching/updating and then restore the scroll bar position after dataArrived. However, we notice that when "fixedRecordHeights" is set to false, there's some internal SmartClient logic to shift the scroll bar to some other positions("scrollToRow in modifyContent"), which breaks our function to restore the scroll bar position.
This can be reproduced on SmartClient v8.3p_2015-05-05_PowerEdition and SmartClient_v91p_2015-02-17_PowerEdition on any browsers. Please try the standalone with "worldDS" dataSource in Feature Explorer.
Steps to reproduce:
1. Scroll down to some position;
2. Click the "Fetch" button.
The scroll bar doesn't remain at the same position before the fetching and get shifted. Please check the attached image for reference.
Please note: there's a small chance that the scroll is not shifted and get restored to the correct position. But mostly, it will be shifted to some other positions.
Thanks,
Robin
We observe an issue that the vertical scroll bar is shift automatically after we restore the scroll bar position after data updates in dataArrived.
Basically, we store the scroll bar position before data fetching/updating and then restore the scroll bar position after dataArrived. However, we notice that when "fixedRecordHeights" is set to false, there's some internal SmartClient logic to shift the scroll bar to some other positions("scrollToRow in modifyContent"), which breaks our function to restore the scroll bar position.
This can be reproduced on SmartClient v8.3p_2015-05-05_PowerEdition and SmartClient_v91p_2015-02-17_PowerEdition on any browsers. Please try the standalone with "worldDS" dataSource in Feature Explorer.
Steps to reproduce:
1. Scroll down to some position;
2. Click the "Fetch" button.
The scroll bar doesn't remain at the same position before the fetching and get shifted. Please check the attached image for reference.
Please note: there's a small chance that the scroll is not shifted and get restored to the correct position. But mostly, it will be shifted to some other positions.
Thanks,
Robin
Code:
isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, dataSource: worldDS, fields:[ {name:"countryCode"}, {name:"countryName"}, {name:"capital"}, {name:"continent"} ], fixedRecordHeights:false, autoFetchData:true, dataArrived: function(startRow, endRow) { // Reset the scroll bar position. if (this.$trueFetch) { var table = this; var scrollBarPos= this.$scrollBarPos; if (scrollBarPos == null) scrollBarPos = 0; isc.Timer.setTimeout(function () { if (table!= null && table.body != null) table.body.scrollTo(0, scrollBarPos); }); this.$scrollBarPos = null; this.$trueFetch = false; } } }); isc.IButton.create({ left:140, top:240, width:150, title:"Fetch", click: function() { countryList.$trueFetch = true; countryList.$scrollBarPos = countryList.body.getScrollTop(); countryList.invalidateCache(); } });
Comment