Dashboard Overview
DashboardJS is a tree of components. Each one owns its own DOM node, its own slice of config, and its own children.
Dashboard the root, and what you construct
βββ UserProfile the sidebar profile card
βββ Tabs the tab strip
β βββ Tab one per entry in config.tabs
β βββ DataManager rows, paging, sorting, filtering, fetching
β βββ Sorting the sort control
β βββ Filtering the keyword box
β βββ ViewSwitcher Cards / List toggle
β βββ Paging the pager
β βββ Recordset the grid or list of records
β βββ Record one per row
β βββ Field one per entry in fields
β βββ Action one per entry in actions
βββ FieldHeaderContainer column headers, List view onlyEvery box in that tree except DataManager inherits from Component, so setText, addClass, getChild, remove and the rest work the same way on all of them.
The config mirrors the tree
Where a component sits in the tree is where its options sit in the config:
Walking the tree
Inside a callback you rarely need to walk anything β the context object hands you component, record, el and dashboard directly.
Lifecycle
init β config is copied onto the component; deprecated keys are rewritten; computed properties are set aside.
render β the template is cloned and the DOM node created.
processEvents β
visibility,iconandurlare resolved, click handlers are attached, thenonRenderfires.mount β the component is appended to its parent, and
onMountfires.removal β
remove()consultsonBeforeRemove, thendelete()detaches the node.
A record is built once for Card view and once for List view, so onRender fires for each β keep it idempotent.
The classes
Component
Dashboard
Tabs
Tab
Recordset
DataManager
Last updated