Skip to content

PixelUI.Table

Extends: PixelUI.Widget

A data table widget with sorting and selection capabilities. Displays tabular data with customizable columns and row selection.

Properties

NameTypeDescription
columnsPixelUI.TableColumn[]Array of column definitions
datatable[]Array of row data objects
sortColumnstring?ID of currently sorted column
sortDirection"asc"|"desc"Sort direction (ascending or descending)
allowRowSelectionbooleanWhether rows can be selected
highlightBgPixelUI.ColorBackground color for selected row
highlightFgPixelUI.ColorForeground color for selected row
placeholderstringText shown when table is empty
onSelectfun(self:PixelUI.Table,
onSortfun(self:PixelUI.Table,
scrollbarPixelUI.ScrollbarConfig?Optional scrollbar configuration

Methods

new

lua
new()

_normalizeColumns

lua
_normalizeColumns()

_recomputeColumnMetrics

lua
_recomputeColumnMetrics()

_ensureColumnsForData

lua
_ensureColumnsForData()

setColumns

lua
setColumns()

getColumns

lua
getColumns()

setData

lua
setData()

getData

lua
getData()

_refreshRows

lua
_refreshRows()

_getColumnById

lua
_getColumnById()

_applySort

lua
_applySort()

setSort

lua
setSort()

getSort

lua
getSort()

setOnSort

lua
setOnSort()

setScrollbar

lua
setScrollbar()

setOnSelect

lua
setOnSelect()

getSelectedIndex

lua
getSelectedIndex()

getSelectedRow

lua
getSelectedRow()

setSelectedIndex

lua
setSelectedIndex()

_notifySelect

lua
_notifySelect()

_getInnerMetrics

lua
_getInnerMetrics()

_computeLayoutMetrics

lua
_computeLayoutMetrics()

_getRowsVisible

lua
_getRowsVisible()

_clampScroll

lua
_clampScroll()

_ensureSelectionVisible

lua
_ensureSelectionVisible()

_rowFromPoint

lua
_rowFromPoint()

_columnFromPoint

lua
_columnFromPoint()

_formatCell

lua
_formatCell()

draw

lua
draw()

_handleTypeSearch

lua
_handleTypeSearch()

_searchForPrefix

lua
_searchForPrefix()

onFocusChanged

lua
onFocusChanged()

handleEvent

lua
handleEvent()

Released under the MIT License.