[英]how to show second page as starting page on load of simple pager in gwt
I selected 5 th record from the second page of datagrid. 我从datagrid的第二页中选择了第5条记录。 After some modifications in the selected row i saved it And reloaded the datagrid.I want previous selected row to be selected after reloading also. 在选择的行中进行一些修改后,我将其保存并重新加载了datagrid。我也希望在重新加载后也选择之前选择的行。
Any help can be appreciated. 任何帮助,我们将不胜感激。
Assuming that you still have the instance of your DTO
that you were editing in your DataGrid
you can do following: 假设您仍然具有在DataGrid
中编辑的DTO
实例,则可以执行以下操作:
// 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.