Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@90940 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-05 16:04:06 +00:00 committed by Giancarlo Panichi
parent e88f23752c
commit 821f41e726
1 changed files with 24 additions and 9 deletions

View File

@ -9,6 +9,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridHeaderColumnMenuItemEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.GridHeaderColumnMenuItemType;
import org.gcube.portlets.user.tdwx.client.config.Row;
@ -43,6 +44,8 @@ import com.google.gwt.event.shared.EventBus;
import com.google.gwt.http.client.RequestBuilder;
import com.sencha.gxt.core.client.Style.SelectionMode;
import com.sencha.gxt.core.client.resources.ThemeStyles;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.data.client.loader.HttpProxy;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.loader.PagingLoadConfig;
@ -85,7 +88,7 @@ public class TabularDataXGridPanel extends ContentPanel {
protected Grid<DataRow> grid;
protected VerticalLayoutContainer container;
protected LiveGridView<DataRow> liveGridView;
protected ExtendedLiveGridView liveGridView;
protected DataRowPagingReader reader;
@ -107,6 +110,7 @@ public class TabularDataXGridPanel extends ContentPanel {
this.eventBus = eventBus;
bindEventBus();
container = new VerticalLayoutContainer();
setWidget(container);
}
@ -297,25 +301,26 @@ public class TabularDataXGridPanel extends ContentPanel {
proxy, reader);
loader.setRemoteSort(true);
liveGridView = new LiveGridView<DataRow>();
liveGridView = new ExtendedLiveGridView();
liveGridView.setRowHeight(11);
grid = new Grid<DataRow>(store, columnModel);
grid.setLoadMask(true);
grid.setLoader(loader);
grid.setView(liveGridView);
// grid.setBorders(true);
// TODO remove(0);
container.add(grid, new VerticalLayoutData(1, 1));
container.add(grid, new VerticalLayoutData(1, 1, new Margins(0)));
// numberer.initPlugin(grid);
ToolBar toolBar = new ToolBar();
toolBar.add(new LiveToolItem(grid));
// toolBar.add(new LabelToolItem("my label"));
container.add(toolBar, new VerticalLayoutData(1, 25));
// toolBar.addStyleName(ThemeStyles.getStyle().borderTop());
// toolBar.getElement().getStyle().setProperty("borderBottom",
// "none");
toolBar.addStyleName(ThemeStyles.getStyle().borderTop());
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
container.add(toolBar, new VerticalLayoutData(1, 25, new Margins(0)));
container.forceLayout();
@ -443,5 +448,15 @@ public class TabularDataXGridPanel extends ContentPanel {
}
return columnId;
}
protected class ExtendedLiveGridView extends LiveGridView<DataRow> {
@Override
public void refresh(boolean headerToo) {
preventScrollToTopOnRefresh = true;
super.refresh(headerToo);
}
};
}