protected List<ColumnData> getColumnData() { int colCount = cm.getColumnCount(); List<ColumnData> cs = new ArrayList<ColumnData>(); for (int i = 0; i < colCount; i++) { String name = cm.getDataIndex(i); ColumnData data = new ColumnData(); data.name = name == null ? cm.getColumnId(i) : name; data.renderer = cm.getRenderer(i); data.id = cm.getColumnId(i); data.style = getColumnStyle(i, false); cs.add(data); } return cs; }
protected void onHiddenChange(ColumnModel cm, int col, boolean hidden) { updateColumnHidden(col, hidden); if (grid.isStateful()) { Map<String, Object> state = grid.getState(); state.put("hidden" + cm.getColumnId(col), hidden); grid.saveState(); } }
protected void onColumnWidthChange(int column, int width) { if (forceFit) { fitColumns(false, false, column); header.updateTotalWidth(getOffsetWidth(), getTotalWidth()); } else { updateColumnWidth(column, width); header.updateTotalWidth(getOffsetWidth(), getTotalWidth()); if (GXT.isIE) { syncHeaderScroll(); } } if (grid.isStateful()) { Map<String, Object> state = grid.getState(); state.put("width" + cm.getColumnId(column), width); grid.saveState(); } }
@Override protected void onMouseDown(GridEvent<ModelData> ge) { El el = ge.getTargetEl(); if (el != null && el.hasStyleName("x-grid3-cc-" + getId()) && !el.hasStyleName("x-grid3-check-col-disabled")) { ge.stopEvent(); UserPermissionDTO m = (UserPermissionDTO) ge.getModel(); PermissionType permission = PermissionType.valueOf(grid.getColumnModel().getColumnId(ge.getColIndex())); Record r = store.getRecord(m); Boolean b = m.get(getDataIndex()); if (validateChange(m, permission)) { boolean newValue = b == null ? true : !b; r.set(getDataIndex(), newValue); onRowEdit(permission, newValue, r); } } } }
public void handleEvent(GridEvent<RuleModel> be) { Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE, new String[]{"DEBUG","Resizing " + be.getGrid().getColumnModel().getColumnId(be.getColIndex())}); for (int i = 0; i < be.getGrid().getStore().getCount(); i++) { // there should be only 1 row // let's force a resize on all the columns for (int col = 0; col < be.getGrid().getColumnModel().getColumnCount(); col++) { // final Widget widget = be.getGrid().getView().getWidget(i, be.getColIndex()); final Widget widget = be.getGrid().getView().getWidget(i, col); // Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE, // new String[]{"DEBUG","Resizing " + widget.getClass().getName() + "--" + widget.getTitle()}); int colWidth = be.getGrid().getColumnModel().getColumn(col).getWidth(); if ((widget != null) && (widget instanceof BoxComponent)) { // ((BoxComponent) widget).setWidth(be.getWidth() - offset); ((BoxComponent) widget).setWidth(colWidth - offset); } } } } }
cf.setStyleName(row, i, "x-grid3-header x-grid3-hd x-grid3-cell x-grid3-td-" + cm.getColumnId(i)); cf.getElement(row, i).setAttribute("role", "presentation"); cf.getElement(row, i).setPropertyInt("gridColumnIndex", i); cf.setStyleName(row, i, "x-grid3-header x-grid3-hd x-grid3-cell x-grid3-td-" + cm.getColumnId(i));
"x-grid3-cell x-grid3-footer-cell x-grid3-td-" + cm.getColumnId(i) + " " + cellStyle); HorizontalAlignment align = cm.getColumnAlignment(i);
ColumnHeader ch = grid.getView().getHeader(); int idx = ch.indexOf(selectedHeader); String id = grid.getColumnModel().getColumnId(idx); if (id == null || !id.equals("checker")) { grid.getView().getHeader().showColumnMenu(idx);