String groupField = getGroupField(); int colIndex = cm.findColumnIndex(groupField);
@Override protected String renderRows(int startRow, int endRow) { String groupField = getGroupField(); boolean eg = groupField != null; if (!showGroupedColumn) { int colIndex = cm.findColumnIndex(groupField); if (!eg && lastGroupField != null) { mainBody.update(""); cm.setHidden(cm.findColumnIndex(lastGroupField), false); lastGroupField = null; } else if (eg && (lastGroupField == null || lastGroupField == groupField)) { lastGroupField = groupField; cm.setHidden(colIndex, true); } else if (eg && lastGroupField != null && !groupField.equals(lastGroupField)) { mainBody.update(""); int oldIndex = cm.findColumnIndex(lastGroupField); cm.setHidden(oldIndex, false); lastGroupField = groupField; cm.setHidden(colIndex, true); } } return super.renderRows(startRow, endRow); }
@Override protected void onRemove(ListStore<ModelData> ds, ModelData m, int index, boolean isUpdate) { super.onRemove(ds, m, index, isUpdate); String groupField = getGroupField(); if (enableGrouping) { String id = getGroupId(grid.getId(), groupField, getGroup(m.get(groupField), m, index, cm.findColumnIndex(groupField), ds)); Element g = XDOM.getElementById(id); if (g != null && !g.getChildNodes().getItem(1).hasChildNodes()) { fly(g).removeFromParent(); removeGroupId(id); } } // apply empty text }