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(); } }
if (lastViewWidth != vw) { fitColumns(false, false, -1); header.updateTotalWidth(getOffsetWidth(), getTotalWidth()); if (footer != null) { footer.updateTotalWidth(getOffsetWidth(), getTotalWidth()); header.updateTotalWidth(getOffsetWidth(), getTotalWidth()); if (footer != null) { footer.updateTotalWidth(getOffsetWidth(), getTotalWidth());
protected void updateColumnHidden(int index, boolean hidden) { int tw = getTotalWidth(); String display = hidden ? "none" : ""; El.fly(innerHd.dom.getFirstChildElement()).setWidth(getOffsetWidth()); El.fly(innerHd.dom.getFirstChildElement().getFirstChildElement()).setWidth(tw); header.updateColumnHidden(index, hidden); if (footer != null) { footer.updateTotalWidth(getOffsetWidth(), tw); footer.updateColumnHidden(index, hidden); } NodeList<Element> ns = getRows(); for (int i = 0, len = ns.getLength(); i < len; i++) { Element elem = ns.getItem(i); elem.getStyle().setProperty("width", tw + "px"); TableSectionElement e = (TableSectionElement) elem.getFirstChild(); if (e != null) { e.getStyle().setProperty("width", tw + "px"); Element cell = e.getRows().getItem(0).getChildNodes().getItem(index).cast(); cell.getStyle().setProperty("display", display); } } templateOnColumnHiddenUpdated(index, hidden, tw); lastViewWidth = -1; layout(); syncHScroll(); }
protected void updateColumnWidth(int col, int width) { int tw = getTotalWidth(); int w = getColumnWidth(col); header.updateTotalWidth(-1, tw); header.updateColumnWidth(col, width); if (footer != null) { footer.updateTotalWidth(getOffsetWidth(), tw); footer.updateColumnWidth(col, width); } NodeList<Element> ns = getRows(); for (int i = 0, len = ns.getLength(); i < len; i++) { Element row = ns.getItem(i); row.getStyle().setPropertyPx("width", tw); if (row.getFirstChild() != null) { row.getFirstChildElement().getStyle().setPropertyPx("width", tw); TableSectionElement e = row.getFirstChild().cast(); ((Element) e.getRows().getItem(0).getChildNodes().getItem(col)).getStyle().setPropertyPx("width", w); } } templateOnColumnWidthUpdated(col, w, tw); syncHScroll(); }