:: Forum >> Version 2 >>

Replacing data in grid issue

Has anyone ever replaced the data in the grid only to not see it displayed? I have a scenario down that seems to fail every time. If I have a grid with 1000 records and scroll down a few hundred rows, then reload the data with a set that only contains 10 rows, the data does not display. I can go from the 1000 row data set to the 10 row data set with no problems if I don't scroll down the grid. Here is the code I am using to replace the data:

var cols loadDoc('getDispatchHeader.htt?target=' toolID);
cols = eval(unescape(cols));
var 
data loadDoc('getDispatchData.htt?target=' toolID);
data = eval(data);
this.Grid.setCellText(function(c,r){return unescape(data[r][c])});
this.Grid.setRowCount(data.length);
this.Grid.setHeaderText(cols);
this.Grid.setColumnCount(cols.length);
this.Grid.setSelectedRows([]);
this.Grid.setCurrentRow(0);
this.Grid.refresh(); 
I tried to call clear() before loading the data but doing so causes the mouse events to stop working. The calls to setSelectedRows and setCurrentRow were added to try and clear up the problem with failed results.

Any thoughts would be appreciated.

Jim Hunter (www.FriendsOfAW.com)
Tuesday, April 11, 2006
Jim,

you should also clear scroll top property -

obj.setScrollTop(0);
Alex (ActiveWidgets)
Tuesday, April 11, 2006
That did the trick! So simple, thanks!
Jim Hunter (www.FriendsOfAW.com)
Tuesday, April 11, 2006



This topic is archived.

Back to support forum

Forum search