datagridの2ページ目から5番目のレコードを選択しました。選択した行にいくつかの変更を加えた後、それを保存してデータグリッドをリロードしました。リロード後にも前に選択した行を選択したいと思います。
どんな助けでも感謝することができます。
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