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 String getRenderedValue(ColumnData data, int rowIndex, int colIndex, ModelData m, String property) { GridCellRenderer<ModelData> r = cm.getRenderer(colIndex); List<Widget> rowMap = widgetList.get(rowIndex); rowMap.add(colIndex, null); if (r != null) { Object o = r.render(ds.getAt(rowIndex), property, data, rowIndex, colIndex, ds, grid); if (o instanceof Widget) { Widget w = (Widget) o; rowMap.set(colIndex, w); return ""; } else if (o != null) { return o.toString(); } } Object val = m.get(property); ColumnConfig c = cm.getColumn(colIndex); if (val != null && val instanceof Number && c.getNumberFormat() != null) { Number n = (Number) val; val = c.getNumberFormat().format(n.doubleValue()); } else if (val != null && val instanceof Date && c.getDateTimeFormat() != null) { DateTimeFormat dtf = c.getDateTimeFormat(); val = dtf.format((Date) val); } String text = null; if (val != null) { text = val.toString(); } return Util.isEmptyString(text) ? " " : text; }
@Override protected String getRenderedValue(ColumnData data, int rowIndex, int colIndex, ModelData m, String property) { GridCellRenderer<ModelData> r = cm.getRenderer(colIndex); List<Widget> rowMap = widgetList.get(rowIndex); rowMap.add(colIndex, null);