:: Forum >>

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
Monday, November 27, 2006
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
Tuesday, November 28, 2006
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
Tuesday, November 28, 2006
Volker,

you may try internal 'adjustScrollHeight' event -

obj.setRowCount(...);
obj.raiseEvent("adjustScrollHeight");
Alex (ActiveWidgets)
Tuesday, November 28, 2006
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
Thursday, July 12, 2007

This topic is archived.


Back to support forum

Forum search