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 GridAndCellSelectionModel<DataRow> sm;
|
||||||
|
|
||||||
|
private TDXLiveToolItem tdxLiveToolItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param eventBus
|
* @param eventBus
|
||||||
*/
|
*/
|
||||||
|
@ -805,7 +807,9 @@ public class TabularDataXGridPanel extends ContentPanel {
|
||||||
|
|
||||||
toolBar = new ToolBar();
|
toolBar = new ToolBar();
|
||||||
// toolBar.add(new LiveToolItem(grid));
|
// toolBar.add(new LiveToolItem(grid));
|
||||||
toolBar.add(new TDXLiveToolItem(grid));
|
tdxLiveToolItem=new TDXLiveToolItem(grid);
|
||||||
|
|
||||||
|
toolBar.add(tdxLiveToolItem);
|
||||||
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
||||||
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
|
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
|
||||||
|
|
||||||
|
@ -829,6 +833,7 @@ public class TabularDataXGridPanel extends ContentPanel {
|
||||||
Log.debug("Setup grid not null");
|
Log.debug("Setup grid not null");
|
||||||
// TODO we need to manually reset the sort
|
// TODO we need to manually reset the sort
|
||||||
sm.onChangeNumberOfRows();
|
sm.onChangeNumberOfRows();
|
||||||
|
tdxLiveToolItem.setNoSelected();
|
||||||
loader.clearSortInfo();
|
loader.clearSortInfo();
|
||||||
reader.setDefinition(tableDefinition);
|
reader.setDefinition(tableDefinition);
|
||||||
grid.reconfigure(store, columnModel);
|
grid.reconfigure(store, columnModel);
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class TDXLiveToolItem extends LiveToolItem {
|
||||||
public interface TDXLiveToolItemMessages extends LiveToolItemMessages {
|
public interface TDXLiveToolItemMessages extends LiveToolItemMessages {
|
||||||
|
|
||||||
String displayMessage(int totalSelected);
|
String displayMessage(int totalSelected);
|
||||||
|
String displayNoSelectedMessage();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,6 +79,13 @@ public class TDXLiveToolItem extends LiveToolItem {
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String displayNoSelectedMessage() {
|
||||||
|
String msg = new String("<span>Displaying " + start
|
||||||
|
+ " - " + end + " of " + total + "</span>");
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private HandlerRegistration handlerRegistration;
|
private HandlerRegistration handlerRegistration;
|
||||||
|
@ -123,6 +131,11 @@ public class TDXLiveToolItem extends LiveToolItem {
|
||||||
setLabel(getMessages().displayMessage(
|
setLabel(getMessages().displayMessage(
|
||||||
totalCount == 0 ? 0 : viewIndex + 1, i, (int) totalCount));
|
totalCount == 0 ? 0 : viewIndex + 1, i, (int) totalCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setNoSelected(){
|
||||||
|
setLabel(getMessages().displayNoSelectedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue