Skip to content

Search

Dokumentasjon

widget_table

The rows a table reads: its columns and how they sort. The widget_table component of the Balaur game engine: its 4 properties, and the functions a script…

På denne siden

ui · 4 properties · UI

The rows a table reads: its columns and how they sort.

In a scene, widget_table is the node key that applies it. A script reaches each property below as a field on node.widget_table: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.widget_table.get() and node.widget_table.set(table).

Properties

property type default description
sort string — The column the rows are ordered by, by the name in titles; empty leaves them in the order they were given. A cell that starts with a number sorts as one, so 12 KB follows 3 KB. The widget's reverse takes them the other way round
sortable bool false Let a click on the header sort by that column, and the next click on the same one turn it round; the column sorted by carries a caret
titles list [] A table's column names, in order, and with them how many columns it has: a name ending in > draws its column against the right edge, which is what a column of numbers wants. None takes the first row as the names
widths list [] Each column's share of the width, in the order titles names them: ["2", "1", "1"] gives the first half and the other two a quarter each. Numbers and the text of them both; empty divides the width evenly, and a drag on a seam in the header writes the shares back