UI Table
Sortable data table; raises row_selected and sorted.
Type: UITableNode · Category: UI & Interface · Also found as: uitable
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
size |
vec2 | (540, 280) |
Width and height (px). Range 4 to 1280. |
selectedRow |
integer | 0 |
Index of the selected row. |
sortColumn |
integer | 0 |
Column the rows are sorted by. |
sortAscending |
boolean | true |
Sort ascending (else descending). |
headerHeight |
number | 32 |
Height of the header (px). Range 20 to 60. |
rowHeight |
number | 28 |
Height of each row (px). Range 18 to 48. |
Plus the common properties every node has.
Lua methods
Section titled “Lua methods”Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.
UITableNode:connect(event, handler)
Section titled “UITableNode:connect(event, handler)”Connects a handler to one of this node’s events: row_selected (A table row was selected), sorted (The table was sorted); the tree events; custom ones.
self.node:connect("row_selected", function(value, source) Log.info("row_selected") end)eventUITableNodeEvent|stringhandlerfun(value:any, source: UITableNode)
Returns integer id Connection id for disconnect
UITableNode:get_property(path)
Section titled “UITableNode:get_property(path)”Reads an Inspector property by its path (vectors and colours as tables); “script.
local value = self.node:get_property("size")pathUITableNodeProperty|string
Returns any
UITableNode:set_property(path, value, y)
Section titled “UITableNode:set_property(path, value, y)”Sets an Inspector property by its path: vectors as {x, y} or x, y; colours as {r, g, b[, a]} 0..1 or “#rrggbb[aa]”; enums by name; “script.
self.node:set_property("size", 100, 50)pathUITableNodeProperty|stringvalueanyy?number
In a scene file
Section titled “In a scene file”{ "type": "UITableNode", "name": "UITable", "position": [ 0, 0 ], "properties": { "size": [ 540, 280 ], "selectedRow": 0, "sortColumn": 0 }}