private int getColCount() { return grdVitals.getColumns().getChildren().size(); }
private int getColumnIndex(Column col) { return grdVitals.getColumns().getChildren().indexOf(col); }
private Column getColumn(int col) { return (Column) grdVitals.getColumns().getChildren().get(col); }
private void fixDirection(Grid grid, boolean ascending) { _ignoreSort = true; //maintain for (Iterator it = grid.getColumns().getChildren().iterator(); it.hasNext();) { final Column hd = (Column) it.next(); hd.setSortDirection(hd != this ? "natural" : ascending ? "ascending" : "descending"); } _ignoreSort = false; }
@SuppressWarnings("unchecked") private void sortGroupsModel(Grid grid, GroupsSortableModel model, Comparator cmpr, boolean ascending) { model.sort(cmpr, ascending, grid.getColumns().getChildren().indexOf(this)); }
/** Returns the column that is in the same column as * this footer, or null if not available. */ public Column getColumn() { final Grid grid = getGrid(); if (grid != null) { final Columns cs = grid.getColumns(); if (cs != null) { final int j = getColumnIndex(); final List<Column> cschs = cs.getChildren(); if (j < cschs.size()) return cschs.get(j); } } return null; }
/** * Sort the rows based on {@link Column#getSortDirection}. * @return whether the method susseed or not */ private static boolean doSort(Grid grid) { Columns cols = grid.getColumns(); if (!grid.isAutosort() || cols == null) return false; for (Iterator it = cols.getChildren().iterator(); it.hasNext();) { final Column hd = (Column) it.next(); String dir = hd.getSortDirection(); if (!"natural".equals(dir)) { return hd.doSort("ascending".equals(dir)); } } return false; }
/** * Initializes the controller. Loads user preferences and properties. */ @Override protected void initializeController() { setMeshElement(grid, "grid"); super.initializeController(); grid.setRowRenderer(rowRenderer); boolean expandAll = getPropertyValue(Constants.PROPERTY_ID_EXPAND_DETAIL, Boolean.class, chkExpandAll != null && chkExpandAll.isChecked()); if (this.chkExpandAll != null) { this.chkExpandAll.setChecked(expandAll); } AbstractRowRenderer.setExpandDetail(grid, expandAll); if (grid.getColumns() != null) { RowComparator.autowireColumnComparators(grid.getColumns().getChildren()); } grid.setVflex("1"); }
private Column addColumn() { Column col = new Column(); grdVitals.getColumns().insertBefore(col, colRange); col.setSclass(SCLASS_UNMARKED); col.setWidth("12em"); col.setAlign("center"); DateTimebox dtb = new DateTimebox(); dtb.addForward(Events.ON_CHANGE, root, "onDateChange"); col.appendChild(dtb); return col; }
try { final ListModel model = grid.getModel(); int index = grid.getColumns().getChildren().indexOf(this); if (model != null) { //live data if (!(model instanceof GroupsSortableModel))
wh.write("<div id=\"").write(uuid).write("\" z.type=\"zul.grid.Grid\""); wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">"); if(self.getColumns() != null){ wh.write("<div id=\"").write(uuid).write("!head\" class=\"").write(zcls).write("-header\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); if(self.getColumns() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getColumns().getUuid()).write("!hdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getColumns().getChildren().iterator(); it.hasNext();) { final Column child = (Column) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!hdfaker\"").write(child.getOuterAttrs()) wh.write(" style=\"table-layout:fixed\""); wh.write(">"); if(self.getColumns() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getColumns().getUuid()).write("!bdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getColumns().getChildren().iterator(); it.hasNext();) { final Column child = (Column) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!bdfaker\"").write(child.getOuterAttrs()) wh.write("<div id=\"").write(uuid).write("!foot\" class=\"").write(zcls).write("-footer\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); if(self.getColumns() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getColumns().getUuid()).write("!ftfaker\" class=\"").write(zcls).write("-faker\">");
if(self.getColumns() != null){ wh.write("<div id=\"").write(uuid).write("!head\" class=\"").write(zcls).write("-header\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); if(self.getColumns() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getColumns().getUuid()).write("!hdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getColumns().getChildren().iterator(); it.hasNext();) { final Column child = (Column) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!hdfaker\"").write(child.getOuterAttrs()) wh.write(" style=\"table-layout:fixed\""); wh.write(">"); if(self.getColumns() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getColumns().getUuid()).write("!bdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getColumns().getChildren().iterator(); it.hasNext();) { final Column child = (Column) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!bdfaker\"").write(child.getOuterAttrs()) wh.write("<div id=\"").write(uuid).write("!foot\" class=\"").write(zcls).write("-footer\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); if(self.getColumns() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getColumns().getUuid()).write("!ftfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getColumns().getChildren().iterator(); it.hasNext();) { final Column child = (Column) it.next();