0

datagridの2ページ目から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 に答える