VirtualTableView
High-performance virtualized grid/table view widget supporting column resizing, reordering, sorting, and cell editing.
Overview
VirtualTableView renders large tabular data sets with high performance by virtualizing rows. Features draggable column headers, column resizing, interactive sort indicators, cell selection models, keyboard navigation, and inline cell editing.
Basic Table Setup
VirtualTableView table = new VirtualTableView()
.addColumn("ID", 60.0f)
.addColumn("Name", 150.0f)
.addColumn("Score", 80.0f)
.rowCount(1000);
API
API
| Method | Description |
|---|---|
addColumn(String, float) |
Appends a new column with specified header and width. |
columnResizeEnabled(boolean) |
Controls whether user can drag column borders to resize columns. |
columnWidth(int) |
Returns width in pixels of column at given index. |
columns(List) |
Sets or retrieves the list of table column definitions. |
minColumnWidth(float) |
Returns or sets minimum allowed column width when resizing. |
moveColumn(int, int) |
Reorders column from old index to new index. |
resizeColumn(int, float) |
Sets width of column at given index. |
rowCount() |
Returns or sets the total number of virtual rows. |
rowCount(int) |
Returns or sets the total number of virtual rows. |
VirtualTableView::addColumn(String, float)
Add Column
Appends a new column with specified header and width.
| Parameter | Type | Description |
|---|---|---|
header |
String |
Text displayed in the column header. |
width |
float |
Initial column width in UI pixels; constrained by the minimum column width. |
Returns VirtualTableView: This table for fluent configuration..
VirtualTableView::columnResizeEnabled(boolean)
Column Resize Enabled
Controls whether user can drag column borders to resize columns.
| Parameter | Type | Description |
|---|---|---|
columnResizeEnabled |
boolean |
— |
Returns VirtualTableView.
VirtualTableView::columnWidth(int)
Get Column Width
Returns width in pixels of column at given index.
| Parameter | Type | Description |
|---|---|---|
columnIndex |
int |
— |
Returns float.
VirtualTableView::columns(List)
Columns List
Sets or retrieves the list of table column definitions.
| Parameter | Type | Description |
|---|---|---|
columns |
List |
Columns in display order; null clears all columns and null entries are skipped. |
Returns VirtualTableView: This table for fluent configuration..
VirtualTableView::minColumnWidth(float)
Min Column Width
Returns or sets minimum allowed column width when resizing.
| Parameter | Type | Description |
|---|---|---|
minColumnWidth |
float |
— |
Returns VirtualTableView.
VirtualTableView::moveColumn(int, int)
Move Column
Reorders column from old index to new index.
| Parameter | Type | Description |
|---|---|---|
oldIndex |
int |
— |
newIndex |
int |
— |
Returns VirtualTableView.
VirtualTableView::resizeColumn(int, float)
Resize Column
Sets width of column at given index.
| Parameter | Type | Description |
|---|---|---|
columnIndex |
int |
— |
width |
float |
— |
Returns VirtualTableView.
VirtualTableView::rowCount()
Row Count
Returns or sets the total number of virtual rows.
Returns int: The number of rows currently exposed by the virtualized table..
VirtualTableView::rowCount(int)
Row Count
Returns or sets the total number of virtual rows.
| Parameter | Type | Description |
|---|---|---|
rowCount |
int |
New row count; negative values are normalized to zero. |
Returns VirtualTableView: This table for fluent configuration..
Rows and Columns
| Method | Description |
|---|---|
insertRows(int, int) |
Inserts a range of rows at a model index. |
addRow() |
Appends one row to the table. |
removeRows(int, int) |
Removes a clamped row range and updates related state. |
VirtualTableView::insertRows(int, int)
Insert rows
Inserts a range of rows at a model index.
| Parameter | Type | Description |
|---|---|---|
index |
int |
Insertion index, clamped to the range from zero through the current row count. |
count |
int |
Number of rows to insert; non-positive values are ignored. |
Returns VirtualTableView: This table for fluent configuration..
VirtualTableView::addRow()
Append a row
Appends one row to the table.
Returns VirtualTableView: This table for fluent configuration..
VirtualTableView::removeRows(int, int)
Remove rows
Removes a clamped row range and updates related state.
| Parameter | Type | Description |
|---|---|---|
index |
int |
First model row to remove; clamped to an existing row when rows are present. |
count |
int |
Maximum number of rows to remove; non-positive values are ignored. |
Returns VirtualTableView: This table for fluent configuration..
Sorting
| Method | Description |
|---|---|
sortBy(int, SortDirection) |
Sets the active sort column and direction. |
VirtualTableView::sortBy(int, SortDirection)
Sort rows
Sets the active sort column and direction.
| Parameter | Type | Description |
|---|---|---|
columnIndex |
int |
Displayed column index to sort by; ignored when direction is NONE. |
direction |
SortDirection |
Sort direction; null or NONE clears sorting. |
Returns VirtualTableView: This table for fluent configuration..
Cell Editing
| Method | Description |
|---|---|
beginEdit(int, int) |
Starts editing the requested row and displayed column when editing is enabled. |
commitEdit() |
Completes the active edit and emits the committed text. |
VirtualTableView::beginEdit(int, int)
Begin cell editing
Starts editing the requested row and displayed column when editing is enabled.
| Parameter | Type | Description |
|---|---|---|
row |
int |
Model row index to edit. |
column |
int |
Displayed column index to edit. |
Returns VirtualTableView: This table for fluent configuration..
VirtualTableView::commitEdit()
Commit cell editing
Completes the active edit and emits the committed text.
Returns VirtualTableView: This table for fluent configuration..