Data Table Editors
Ready-made editors for DataTableHeader.editorContent and the matching cell renderers, for the columns that do not want a free-text field.
DataTableHeader<Employee>(
key = "department",
value = { it.department },
editable = true,
cellContent = DataTableEditors.dropdownCell { it.department },
editorContent = DataTableEditors.dropdown(listOf("Finance", "IT", "Sales")),
)
DataTableHeader<Employee>(
key = "active",
value = { it.active },
editable = true,
editOnClick = true,
cellContent = DataTableEditors.checkboxCell { it.active },
editorContent = DataTableEditors.checkbox(),
)Content copied to clipboard
Both editors commit through the column's validateEdit and report through onCellEdit like the built-in text field, so the reported text is the chosen option, or "true" / "false".
Functions
Link copied to clipboard
A boolean editor that flips the cell as soon as it opens, so Enter, F2, or a double-click toggles the value in one step. Pair it with checkboxCell so the cell shows the state, and with DataTableHeader.editOnClick to toggle on a single click.
Link copied to clipboard
Link copied to clipboard