Hi,
I am using a Datagrid that can contain up to 200 rows of data. A scroll bar appears if there is more data than fits in the visible part of the table. The table is repopulated every 10th second automatically (timer) to reflect changes done by other users.
The problem is that when repopulating, the scrollbar is reset back to top. This is annoying if the user has scrolled down in the table. I want to keep the scrolling as is after repopulating. My question is: Is that possible?
I am using a dataProvider and a single selection model.
final DataGrid<MyData> table = new DataGrid<MyData>(5000);
ListDataProvider<MyData> dataProvider = new ListDataProvider<MyData>();
final SingleSelectionModel<MyData> selectionModel = new SingleSelectionModel<MyData>();
Here is my code called when updating the table
List<MyData> list = dataProvider.getList();
for (MyData obj : listAllData) { // listAllData containes updated data
if(obj.isChanged()) { //
for(int i = 0; i < list.size(); i++) {
if(list.get(i).getId() == obj.getId()) {
list.set(i, obj); // replace with updated object
// If object is selected, fire select event
if (obj.getId() == selectedId) {
selectionModel.setSelected(obj, true);
}
break;
}
}
}
}
Thank you for any help.
Regards Jostein
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment