private void calculate() {
isScheduled = false;
rescheduleCount = 0;
-
assert !dataIsBeingFetched : "Trying to calculate column widths even though data is still being fetched.";
if (columnsAreGuaranteedToBeWiderThanGrid()) {
initialWidth = col.getWidthActual();
minCellWidth = escalator
- .getMinCellWidth(getColumns()
+ .getMinCellWidth(getVisibleColumns()
.indexOf(col));
for (Column<?, T> c : getVisibleColumns()) {
if (selectionColumn == c) {
}
});
+ createBooleanAction("Toggle all column hidden state", "Columns", false,
+ new Command<Grid, Boolean>() {
+ @Override
+ public void execute(Grid c, Boolean value, Object data) {
+ for (Column col : grid.getColumns()) {
+ col.setHidden(!col.isHidden());
+ }
+ }
+ });
+
createBooleanAction("All columns resizable", "Columns", false,
new Command<Grid, Boolean>() {
assertGreaterOrEqual("Cell got too small.", cell.getSize().getWidth(),
10);
}
+
+ @Test
+ public void testShrinkColumnToZeroWithHiddenColumn() {
+ openTestURL();
+ selectMenuPath("Component", "Columns",
+ "Toggle all column hidden state");
+ // Hides although already hidden
+ selectMenuPath("Component", "Columns", "Column 0", "Hidden");
+ // Shows
+ selectMenuPath("Component", "Columns", "Column 0", "Hidden");
+ // Hides although already hidden
+ selectMenuPath("Component", "Columns", "Column 2", "Hidden");
+ // Shows
+ selectMenuPath("Component", "Columns", "Column 2", "Hidden");
+ GridCellElement cell = getGridElement().getCell(0, 1);
+ dragResizeColumn(1, 0, -cell.getSize().getWidth());
+ assertGreaterOrEqual("Cell got too small.", cell.getSize().getWidth(),
+ 10);
+ assertEquals(getGridElement().getCell(0, 0).getLocation().getY(),
+ getGridElement().getCell(0, 1).getLocation().getY());
+ }
+
}