This table contains logic to show a table as a panel in an app. This table features sorting rows can be expanded to show hidden data
<FwTableSortable @data= @columns= @title='Table' />
If used in a block format instead, it is possible to fully define the title area, replacing the title parameter. The export action is passed as a yield parameter to redefine the export button
<FwTableSortable @data= @columns= as |export|>
<strong class='panel-title'>Table</strong>
</FwTableSortable>
In addition to the usual properties in columns, fw-table-sortable supports adding an additional sortKey
property
If defined, clicking that column will sort by that property instead of valuePath
It also supports a showExpanded property, which is set to a value which will cause this row to show in the expanded view if hidden.
Alternatively, setting this to true
or false
will force the state regardless of a property.
By default will show if the property from valuePath
is not null
canExport
Boolean | String publicAllows exporting the current contents of the table using an export button. Note that this sets a default title of "Table", so setting a separate one is recommended
When enabled, columns have some additional values defined:
canExport
: if true (default), the column will be included in the export. Set to false to skip exporting the column.exportOnly
: if true, the column will not show in the table, but will still be exported.
Additionally, the value export
is set to true in format
's context.
If this is set to a string, the string is used as the name of the export button.
Default: false
defaultSort
String | Array publicDefault sort order for the table. Can be a string for a single property, or an array to fallback
deleteOverrideTitle
StringDetermines title for delete function. This will only be used if deleteTable action is passed in.
deleteTable
ActionCalled to delete the full page of entries. Pass in the action to be called by the button.
Default: undefined
deleteTablePermissions
BooleanDetermines if the current user has permission to delete the table (usually has-role helper will be used to determine this)
example: @deleteTablePermission={{has-role 'admin'}}
. This will only be used if deleteTable
action is passed in.
Default: true
exportTitle
String privateComputed table title based on whether a boolean true is passed or a title
fixedHeight
String publicSets the table to a fixed height, and adds a scroll bar to see the hidden rows
headerEmpty
Boolean publicSet to false to make the table not show the header if empty
Default: true
resizeOnDrag
Boolean publicMakes the headers able to be dragged to resize. You will still need to put resizable: true
in each column you want to be able to resize.
Default: false
responsive
Boolean publicMakes the table responsive to the screen width. The table is slightly more efficient if false when responsive is not used
Default: false
table
Table protectedInternal table instance, in general changes to the table should be done to columns or data so they update propery