Text of the header cell (used when the header is built from the column definitions).
Whether the column is shown. Hidden columns are not rendered, copied or exported.
ColumnDef.create({ property: "category", headerLabel: "Category", isVisible: FalseFn })
Upper limit for percentage widths ("%"). Not applied to pixel widths or to resizing with the mouse.
Lower limit for percentage widths ("%"). Not applied to pixel widths or to resizing with the mouse.
Readonly optionsThe options (defaults from RowNumberOptions).
Property of the row object shown in this column ("customer"). With nested objects a path like "address.city".
Cell renderers per area – rendererMap.header, .body, .footer.
Without a renderer the value is shown as text.
column.rendererMap.body = new NumberCellProgressBarCellRenderer(20, false);
column.rendererMap.footer = new EuroRenderer(); // an own CellRendererIf
Training: Cell renderers
Readonly typeMarker for isRowNumberColumnDef (works across copies of the core).
Starts with minWidthInPx; the table widens it to fit the largest number.
The number of a body row (1-based): its position in the view ("display") or in getAllRows() ("original").
row index in the body (the current view)
the body model
the row number
const columnDef = new RowNumberColumnDef();
const rowNumber = columnDef.getRowNumber(0, tableModel.getBodyModel()); // 1
The text of a row number: options.format(getRowNumber(…)).
row index in the body
the body model
the text shown in the cell (and exported with exported: true)
const columnDef = new RowNumberColumnDef({ format: n => n.toLocaleString("en-US") });
const text = columnDef.getRowNumberText(1999, tableModel.getBodyModel()); // "2,000"
The text of the largest number the column can show now – the table measures it for the column width.
"display": the row count; "original": the count of all rows (unfiltered). At least the text of 1.
the body model
e.g. "2000000"
const widest = new RowNumberColumnDef().getWidestText(tableModel.getBodyModel()); // "1000" for 1000 rows
A built-in column with running row numbers (1, 2, 3 …) like the row headers of a spreadsheet.
The easy way is the factory flag:
TableFactory.createTableModel({ rows, rowNumbersVisible: true })puts this column in front of the others and fixes it on the left. Put it intocolumnDefsyourself if you build the models yourself – as the first column, counted infixedLeftColumnCount.What the table does with it:
"9"→"2000000") – aftersetRows, filtering, expanding tree rows;role="rowheader"– screen readers announce the number with the row;"row"and"range"), Shift extends, Ctrl/⌘ toggles; a click on the header cell selects all;exported: true;showCheckboxWihoutExtraColumnmove one column to the right.Note: it is a real column – the indices of all other columns are one higher (like with a
CheckboxColumnDef). Use properties where you can (tableApi.setColumnVisible("total", false), TableApi.getColumnIndex).Example
See
Training: Fixed columns
Since
1.1.93