import{_ as d,a as o,b as l,ag as r,p as t,g as a}from"./chunks/framework.BcrMLAmg.js";const f=JSON.parse('{"title":"Table","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Table.md","filePath":"references/elements/Table.md","lastUpdated":1757844696000}'),n={name:"references/elements/Table.md"};function s(i,e,c,u,h,b){return l(),o("div",null,e[0]||(e[0]=[r('

Table

This is the table class. It provides a sortable data grid with customizable columns,row selection, and scrolling capabilities.

Extends: VisualElement

Properties

PropertyTypeDefaultDescription
columnstable{}List of column definitions with {name, width} properties
datatable{}The table data as array of row arrays
headerColorcolorblueColor of the column headers
selectedColorcolorlightBlueBackground color of selected row
gridColorcolorgrayColor of grid lines
sortDirectionstring"asc"Sort direction ("asc" or "desc")
scrollOffsetnumber0Current scroll position
customSortFunctiontable{}Custom sort functions for columns

Functions

MethodReturnsDescription
Table:addColumnTableAdds a new column to the table
Table:addDataTableAdds a new row of data to the table
Table:setColumnSortFunctionTableSets a custom sort function for a column
Table:setFormattedDataTableAdds formatted data with raw sort values
Table:setDataTableSets table data with optional column formatters
Table:sortDataTableSorts the table data by the specified column

Table:addColumn(name, width)

Adds a new column to the table

Parameters

Returns

Table:addData(any)

Adds a new row of data to the table

Parameters

Returns

Table:setColumnSortFunction(columnIndex, sortFn)

Sets a custom sort function for a specific column

Parameters

Returns

Table:setFormattedData(displayData, sortData)

Adds data with both display and sort values

Parameters

Returns

Table:setData(rawData, formatters)

Set data with automatic formatting

Parameters

',34),t("ul",null,[t("li",null,[t("code",null,"rawData"),a(),t("code",null,"table"),a(" The raw data array")]),t("li",{"[2]":""},[t("code",null,"formatters"),a(),t("code",null,"table"),a(" Optional formatter functions for columns")])],-1),r('

Returns

Table:sortData(columnIndex, fn)

Sorts the table data by column

Parameters

Returns

',8)]))}const T=d(n,[["render",s]]);export{f as __pageData,T as default};