Grid component to display a grid of data
Parameters:
Name |
Type |
Description |
node |
object
|
The configuration object for the grid
Properties
Name |
Type |
Description |
data |
object
|
Initial data to populate the grid with |
id |
string
|
The id of the grid |
classes |
string
|
The classes to apply to the grid |
gridHeaderClasses |
string
|
The classes to apply to the grid header |
gridHeader |
array
|
An array of PJSON components to use as the grid header |
dataSourceEndpoint |
object
|
Configuration object for the grid's data source
Properties
Name |
Type |
Description |
target |
object
|
Configuration object for the target of the grid's data source
Properties
Name |
Type |
Description |
uri |
string
|
The uri endpoint for the grid's data source |
dataMapFunctions |
object
|
An object of functions to run on the data
Properties
Name |
Type |
Description |
before |
string
|
Function to run before the data is added to the grid? |
after |
string
|
Function to run after the data is added to the grid? |
|
|
keyMap |
object
|
array
|
A mapper object or array of mapper objects to map keys |
|
pagination |
object
|
An object to specify pagination for the grid
Properties
Name |
Type |
Default |
Description |
start |
number
|
0
|
The number of which page to start the grid at |
limit |
number
|
15
|
The max number of grid items to show on each page |
|
columns |
array
|
An array of objects to build the columns |
selection |
object
|
A PJSON action to use when a row is selected |
options |
object
|
The options pertaining to the grid
Properties
Name |
Type |
Description |
infinite |
boolean
|
Boolean to specify whether to show infinite items on the grid |
fixedHeader |
boolean
|
Boolean to specify if the grid header should be fixed or not |
footer |
object
|
Configuration object for the grid footer
Properties
Name |
Type |
Description |
hideOnDone |
boolean
|
Boolean to hide the footer once the grid is loaded or not |
loadingText |
string
|
A string to show while the grid is loading |
doneText |
string
|
A string to show when the grid has finished loading. |
|
hasChildren |
object
|
Configuration object for a grid row's child
Properties
Name |
Type |
Description |
showIcon |
string
|
The class to apply to the show child button |
hideIcon |
string
|
The class to apply to the hide child button |
template |
string
|
The template to apply to the child row |
onRowSelect |
boolean
|
Boolean to determine whether to show/hide the child on selecting the row or via a button |
accordion |
boolean
|
Boolean to determine if only one child should be shown at a time |
|
clientSearch |
boolean
|
Boolean on whether to search/sort client side |
gridDisplay |
boolean
|
expression
|
Boolean or expression to render the grid programmatically |
scrollElement |
string
|
Element to scroll grid on, defaults to scrolling on window |
|
|
- Source:
Example
{
"type": "grid",
"id": "my_grid_id",
"classes": "grid-container",
"gridHeaderClasses": "grid-header",
"options": {
"infinite": true,
"fixedHeader": true,
"footer": {
"hideOnDone": true,
"loadingText": "Loading...",
"doneText": "Loaded all rows."
},
"hasChildren": {
"showIcon": "icon-open",
"hideIcon": "icon-close",
"template": "grid_child_template",
"onRowSelect": true,
"accordion": true,
},
}
"dataSourceEndpoint": {
"target": {
"uri": "endpoint"
},
"keyMap": {
"resultsKey": "data"
}
},
"pagination": {
"start": 0,
"limit": 30
},
"columns": [
{
"data": "colData",
"title": "Column Data Title"
}
]
}