@Override public void setColumnReorderingAllowed(boolean columnReorderingAllowed) { component.setColumnReorderingAllowed(columnReorderingAllowed); }
/** * Sets whether column reordering is allowed or not. * @param columnReorderingAllowed <code>true</code> if column reordering is allowed */ public void setColumnReorderingAllowed(boolean columnReorderingAllowed) { getGrid().setColumnReorderingAllowed(columnReorderingAllowed); }
/** * Sets whether column reordering is allowed or not. * @param columnReorderingAllowed <code>true</code> if column reordering is allowed */ public void setColumnReorderingAllowed(boolean columnReorderingAllowed) { switch (getRenderingMode()) { case GRID: getGrid().setColumnReorderingAllowed(columnReorderingAllowed); break; case TABLE: getTable().setColumnReorderingAllowed(columnReorderingAllowed); break; default: break; } }
protected void initComponent(Grid<E> component) { setSelectionMode(SelectionMode.SINGLE); component.setColumnReorderingAllowed(true); component.addItemClickListener(this::onItemClick); component.addColumnReorderListener(this::onColumnReorder); component.addSortListener(this::onSort); component.setSizeUndefined(); component.setHeightMode(HeightMode.UNDEFINED); component.setStyleGenerator(this::getGeneratedRowStyle); //noinspection unchecked ((CubaEnhancedGrid<E>) component).setCubaEditorFieldFactory(createEditorFieldFactory()); }
protected Grid createMetadataGrid() { final Grid metadataGrid = new Grid(); metadataGrid.addStyleName(SPUIStyleDefinitions.METADATA_GRID); metadataGrid.setImmediate(true); metadataGrid.setHeight("100%"); metadataGrid.setWidth("100%"); metadataGrid.setId(UIComponentIdProvider.METDATA_TABLE_ID); metadataGrid.setSelectionMode(SelectionMode.SINGLE); metadataGrid.setColumnReorderingAllowed(true); metadataGrid.setContainerDataSource(getMetadataContainer()); metadataGrid.getColumn(KEY).setHeaderCaption(i18n.getMessage("header.key")); metadataGrid.getColumn(VALUE).setHeaderCaption(i18n.getMessage("header.value")); metadataGrid.getColumn(VALUE).setHidden(true); metadataGrid.addSelectionListener(this::onRowClick); metadataGrid.getColumn(DELETE_BUTTON).setHeaderCaption(""); metadataGrid.getColumn(DELETE_BUTTON).setRenderer(new HtmlButtonRenderer(this::onDelete)); metadataGrid.getColumn(DELETE_BUTTON).setWidth(50); metadataGrid.getColumn(KEY).setExpandRatio(1); return metadataGrid; }
protected Grid createMetadataGrid() { final Grid metadataGrid = new Grid(); metadataGrid.addStyleName(SPUIStyleDefinitions.METADATA_GRID); metadataGrid.setImmediate(true); metadataGrid.setHeight("100%"); metadataGrid.setWidth("100%"); metadataGrid.setId(UIComponentIdProvider.METDATA_TABLE_ID); metadataGrid.setSelectionMode(SelectionMode.SINGLE); metadataGrid.setColumnReorderingAllowed(true); metadataGrid.setContainerDataSource(getMetadataContainer()); metadataGrid.getColumn(KEY).setHeaderCaption(i18n.getMessage("header.key")); metadataGrid.getColumn(VALUE).setHeaderCaption(i18n.getMessage("header.value")); metadataGrid.getColumn(VALUE).setHidden(true); metadataGrid.addSelectionListener(this::onRowClick); metadataGrid.getColumn(DELETE_BUTTON).setHeaderCaption(""); metadataGrid.getColumn(DELETE_BUTTON).setRenderer(new HtmlButtonRenderer(this::onDelete)); metadataGrid.getColumn(DELETE_BUTTON).setWidth(50); metadataGrid.getColumn(KEY).setExpandRatio(1); return metadataGrid; }