diff --git a/src/main/java/org/gcube/portlets/user/tdwx/client/TabularDataXGridPanel.java b/src/main/java/org/gcube/portlets/user/tdwx/client/TabularDataXGridPanel.java index 03c41ca..d14a93c 100644 --- a/src/main/java/org/gcube/portlets/user/tdwx/client/TabularDataXGridPanel.java +++ b/src/main/java/org/gcube/portlets/user/tdwx/client/TabularDataXGridPanel.java @@ -101,9 +101,7 @@ public class TabularDataXGridPanel extends ContentPanel { private ListStore store; private Grid grid; - //private ToolBar toolBar; - // protected GridInlineEditing editing; - + private TableDefinition tableDefinition; private VerticalLayoutContainer container; @@ -132,12 +130,9 @@ public class TabularDataXGridPanel extends ContentPanel { private GridAndCellSelectionModel sm; - //private TDXLiveToolItem tdxLiveToolItem; - private PagingToolBar pagingToolBar; - //private FilterPagingLoadConfig lastFilterPagingLoadConfig; - + /** * @param eventBus */ @@ -154,7 +149,7 @@ public class TabularDataXGridPanel extends ContentPanel { container = new VerticalLayoutContainer(); container.setBorders(false); add(container, new MarginData(0)); - // setWidget(container); + } /** @@ -452,15 +447,14 @@ public class TabularDataXGridPanel extends ContentPanel { List> columns = columnModel.getColumns(); List> columnsNew = new ArrayList>(); - // Retrieve Column with conlumnLocalId + DataRowColumnConfig columnTarget = null; - // boolean columnTargetRetrieved = false; for (ColumnConfig col : columns) { columnTarget = (DataRowColumnConfig) col; String columnLocal = columnTarget.getDefinition() .getColumnLocalId(); if (visibleOnlyColumn.compareTo(columnLocal) == 0) { - // columnTargetRetrieved = true; + columnTarget.setHidden(false); columnsNew.add(columnTarget); } else { @@ -689,11 +683,6 @@ public class TabularDataXGridPanel extends ContentPanel { .generateConfiguration(columnDefinition)); } - // IdentityValueProvider identity = new - // IdentityValueProvider(); - // LiveRowNumberer numberer = new - // LiveRowNumberer(identity); - // columnsConfig.add(numberer); columnModel = new ColumnModel(columnsConfig); @@ -745,18 +734,12 @@ public class TabularDataXGridPanel extends ContentPanel { path); builder.setHeader(ServletParameters.TD_SESSION_ID, String.valueOf(tdSessionId)); - // builder.setHeader("Content-Type", - // "application/x-www-form-urlencoded"); + HttpProxy proxy = new HttpProxy( builder); proxy.setWriter(new PagingLoadUrlEncoder(staticFilters)); - /* - if (loader != null) { - lastFilterPagingLoadConfig = loader.getLastLoadConfig(); - - }*/ loader = new PagingLoader>( proxy, reader) { @@ -776,10 +759,6 @@ public class TabularDataXGridPanel extends ContentPanel { .setProperty("borderBottom", "none"); pagingToolBar.bind(loader); - // gridView = new ExtendedGridView(); - - // liveGridView = new ExtendedLiveGridView(); - // liveGridView.setRowHeight(19); grid = new Grid(store, columnModel) { @Override @@ -798,8 +777,7 @@ public class TabularDataXGridPanel extends ContentPanel { grid.setSelectionModel(sm); grid.setLoadMask(true); grid.setLoader(loader); - // grid.setView(gridView); - // grid.setView(liveGridView); + grid.setBorders(false); grid.setColumnReordering(false); @@ -819,21 +797,7 @@ public class TabularDataXGridPanel extends ContentPanel { container.add(grid, new VerticalLayoutData(1, 1, new Margins(0))); container.add(pagingToolBar, new VerticalLayoutData(1, -1)); - /* - * toolBar = new ToolBar(); tdxLiveToolItem = new - * TDXLiveToolItem(grid); - * - * toolBar.add(tdxLiveToolItem); - * toolBar.addStyleName(ThemeStyles.get().style().borderTop()); - * toolBar.getElement().getStyle().setProperty("borderBottom", - * "none"); - * - * container.add(toolBar, new VerticalLayoutData(1, 24, new - * Margins(0))); - */ - // container.forceLayout(); - - // loader.load(0, liveGridView.getCacheSize()); + if (contextMenu != null) { grid.setContextMenu(contextMenu); } else @@ -845,9 +809,7 @@ public class TabularDataXGridPanel extends ContentPanel { } else { Log.debug("Setup grid not null"); - // sm.onChangeNumberOfRows(); - // tdxLiveToolItem.setNoSelected(); - + reader.setDefinition(tableDefinition); loader.clearSortInfo(); @@ -855,26 +817,20 @@ public class TabularDataXGridPanel extends ContentPanel { store)); grid.reconfigure(store, columnModel); - // grid.setLoader(loader); - // pagingToolBar.bind(loader); + // Filter ArrayList> filters = FiltersGenerator .generate(columnModel); - // gridFilters = new ExtendedGridFilters(loader); - - // gridFilters.initPlugin(grid); - // gridFilters.setLocal(false); - + Log.debug("Filters: " + filters.size()); for (Filter filterGeneric : filters) { gridFilters.addFilter(filterGeneric); } loader.load(); - // lastFilterPagingLoadConfig.getOffset(), - // lastFilterPagingLoadConfig.getLimit()); + } if (tableViewConfig != null) { @@ -894,7 +850,7 @@ public class TabularDataXGridPanel extends ContentPanel { grid.getView().setViewConfig( new TabularDataGridViewConfig(tableViewConfig, tableDefinition)); - // grid.getView().setViewConfig(null); + } container.forceLayout();