Fixed Selection on Delete Rows
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@102177 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
137c02ee88
commit
04a227ad6c
|
@ -136,6 +136,8 @@ public class TabularDataXGridPanel extends ContentPanel {
|
|||
|
||||
private GridAndCellSelectionModel<DataRow> sm;
|
||||
|
||||
private TDXLiveToolItem tdxLiveToolItem;
|
||||
|
||||
/**
|
||||
* @param eventBus
|
||||
*/
|
||||
|
@ -805,7 +807,9 @@ public class TabularDataXGridPanel extends ContentPanel {
|
|||
|
||||
toolBar = new ToolBar();
|
||||
// toolBar.add(new LiveToolItem(grid));
|
||||
toolBar.add(new TDXLiveToolItem(grid));
|
||||
tdxLiveToolItem=new TDXLiveToolItem(grid);
|
||||
|
||||
toolBar.add(tdxLiveToolItem);
|
||||
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
||||
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
|
||||
|
||||
|
@ -829,6 +833,7 @@ public class TabularDataXGridPanel extends ContentPanel {
|
|||
Log.debug("Setup grid not null");
|
||||
// TODO we need to manually reset the sort
|
||||
sm.onChangeNumberOfRows();
|
||||
tdxLiveToolItem.setNoSelected();
|
||||
loader.clearSortInfo();
|
||||
reader.setDefinition(tableDefinition);
|
||||
grid.reconfigure(store, columnModel);
|
||||
|
|
|
@ -27,6 +27,7 @@ public class TDXLiveToolItem extends LiveToolItem {
|
|||
public interface TDXLiveToolItemMessages extends LiveToolItemMessages {
|
||||
|
||||
String displayMessage(int totalSelected);
|
||||
String displayNoSelectedMessage();
|
||||
|
||||
}
|
||||
|
||||
|
@ -78,6 +79,13 @@ public class TDXLiveToolItem extends LiveToolItem {
|
|||
return msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayNoSelectedMessage() {
|
||||
String msg = new String("<span>Displaying " + start
|
||||
+ " - " + end + " of " + total + "</span>");
|
||||
return msg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private HandlerRegistration handlerRegistration;
|
||||
|
@ -124,6 +132,11 @@ public class TDXLiveToolItem extends LiveToolItem {
|
|||
totalCount == 0 ? 0 : viewIndex + 1, i, (int) totalCount));
|
||||
}
|
||||
|
||||
|
||||
public void setNoSelected(){
|
||||
setLabel(getMessages().displayNoSelectedMessage());
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void bindGrid(Grid<?> grid) {
|
||||
|
|
Loading…
Reference in New Issue