0

我从数据网格的第二页中选择了第 5 条记录。在选定的行中进行一些修改后,我将其保存并重新加载了数据网格。我希望在重新加载后也选择上一个选定的行。

任何帮助都将不胜感激。

4

1 回答 1

0

假设您仍然有DTO您正在编辑的实例,DataGrid您可以执行以下操作:

// get the start index in the list
int selectedIndex = dataProvider.getList().indexOf(myObj); 
// set the visible range
dataGrid.setVisibleRange(selectedIndex,dataGrid.getVisibleItemCount());
// select the row
selectionModel().setSelected(myObj, true);  // select the row
于 2012-07-20T08:24:20.967 回答