3.2.0

addRow without change of scroll position

Hello,

I want to populate the data source of my grid asynchronously from the server while displaying the first rows to the user in virtual mode. When new rows arrive from the server only the row count has to be updated, scroll position and all currently displayed rows remain unchanged. So only the scrollbar display has to be changed.

How could this be accomplished using the standard virtual mode example?

1. tried to call setRowCount() and refresh()
-> does a full refresh.

2. tried to call addRow()
-> no full refresh, but scrolls to the newly added row.

What would be the best way to do this?
Thanks in advance!
Volker Niepel
November 27,
Hi,

I too face a similar problem , but the only difference is that the row jumps to the bottom of the visible grid view when it is selected. This basically means that the scroll bar position shifts.

I have mentioned it in the thread
http://www.activewidgets.com/javascript.forum.17442.0/hi-alex-the-vertical-scroll.html

Any help would be greatly appreciated.

Thanks

Harish
November 28,
Sorry I forgot to mention that I do not add a new row, I just select one of the displayed rows in the visible view area.
Harish
November 28,
Volker,

you may try internal 'adjustScrollHeight' event -

obj.setRowCount(...);
obj.raiseEvent("adjustScrollHeight");
Alex (ActiveWidgets)
November 28,
I have a similar problem. I am receiving chunks of data 100 rows at a time and need to add it to the grid. To keep the UI responsive I am adding the rows in smaller chunks via an interval with the following code:

gridData[gridData.length] = newData[0];
newData.splice(0, 1);
gridObj.addRow(gridData.length-1);
gridObj.setRowCount(gridData.length);
gridObj.raiseEvent("adjustScrollBars");
gridObj.raiseEvent("adjustScrollHeight");

the items are added nicely one at a time but the grid scrolls down rather than staying at the current position.
Mark Elrod
July 12,

This topic is archived.

See also:


Back to support forum