-
Notifications
You must be signed in to change notification settings - Fork 0
Table
Eric edited this page Feb 2, 2024
·
14 revisions
Table is a sortable table that renders content raw, or render its type instead if content is not
string
ornumber
. It utilizesDynamicList
to render the inner list andTemplater
to render the rows.
Consider the following array
[
{"name" : "Eric", "bio" : "<p>some html</p>", "age": 30, "colors": ["red" "yellow"], "address" : {"street" ...}},
{...}
]
the first row will be rendered as (skipping the HTML rendering and object/array)
"Eric", "</>", "30", "[...]", "{...}"
{"selector:Table": {CONFIG}}
{
"max_rows" : 30, //max number of rows to display per page
"prop_search" : 10, //number of objects cycled to gather properties
"key" : "_id", //a unique key shared by each record
"list" : [],
"mode" : "row|item", //optional, see mode
"mapping" : false //optional, see mapping
}
Table has 2 selection mode, either the whole record using
row
, of a property/value combo usingitem
You can map your fields to display them with a different label and in a desired order
{
...,
"mapping" : {
"some_property" : {"label" : "Some Property", "index" : 1},
"other_property" : {"label" : "Other Property", "index" : 0}
}
}
set list
my_table.val([...]);
get list
my_table.val();
get current page
my_table.page();