Filters
Capabilities
Capability |
Support |
Comment |
|---|---|---|
Customize menu |
||
Choice data to display (filter) |
Filter can be used to choose the data displayed to a user. See menus and toolbar |
|
Define a default filter by table |
A unique default filter can be set for each view. See Default filter |
|
Define a default filter by user or group of user |
The filter cannot be set by user or group of user, only by dashboard. But the local storage can be used to store the filter for a user. |
|
Set views or filter by URL parameters |
The filter can be set by URL parameters, which allows creating links from other widgets or dashboards. See URL parameters |
Concept
There are two kinds of tables on OnSphere Collection Table and Alarm Table, each of them permits to display some information in rows and columns. The alarms table is dedicated to display alarms with a lot of mechanisms linked to this kind of feature. The collection tables permit to display any kind of data in a table.
Filter
A filter is a kind of rule that permits to choose data to display on a table.
Filters
Default filter
Limit the filters for a table
Concept
By default all the filters available for a kind of tables and for the user are showed in the filter dropdown. But it’s possible to limit the filters available for a table.
Use-case
Create multiples collections or alarms tables with different usage, therefore different filters
Have specific filter by kind of user.
Usage
There are two ways to limit the filters available for a table:
Limit the rights Define rights to be able to use a filter the read rights must be set for the user.
Limit the filters available for a table with the property includeFilters and excludeFilters.
Includes/excludes
The filter to include in the table. Theses filters can be filtered by using the properties includeFilters and excludeFilters. If you set both, it will first remove all filters not present in the include list and then remove, from that list, the filters presents in the exclude list.
The wildcard “*” can be used to replace any subpath.
“root.alarms.*” will match any direct filter children of “alarms” but excludes “root.alarms” itself.
Views
Views define the structure of the table. It defines the different columns with options to filter or sort the content of the table.
The column views options are (in view):
formatter: specifies the date format (see https://day.js.org/docs/en/display/format). Used byTIMESTAMPrender.formatterExport: specifies the date Excel format export. Used byTIMESTAMPrender when exporting.disableTimezoneExport: disables user timezone usage when exporting to Excel format. The date will be displayed in UTC. Used byTIMESTAMPrender when exporting.schemaId: specifies the schema ID to use (ie. root.collection.schema) to query. Used byCOLLECTIONrender.format: specifies the property to display from schema ID. Used byCOLLECTIONrender.depth: specifies the depth at which to getnodesfrom. Used byCOLLECTIONrender.dependsOn: change the behavior of a column filter based on the content of another filter. Used byCOLLECTIONrender. Can be used withschemaIdanddepthto filter a query results based on another filter we made before.search: defines how the column filter searches the entries it offers, as{"method": "<local or remote>", "fields": ["<field-name>", ...]}. Used byCOLLECTIONrender. Withlocal, the default, the front-end filters the entries it already received. Withremote, the term is sent to the collections module and matched againstfields. A query returns at most 1000 entries, soremoteis the only way to reach them all in a larger collection. The equivalent options on the form component are namedsearchMethodandsearchTerms.samePage: specifies whether to open URL in the same page or not (boolean value). Used byURLrender.
JSON render
A column can use the JSON render to display a JSON value (object, array or scalar) held by a cell.
In the table, objects and arrays are shown as a compact summary ({...} / [...] with the number of items). Clicking the cell opens a modal displaying the value with the same collapsible, theme-aware viewer as the Json widget. Scalar values are displayed directly in the cell.
A JSON column is filterable with a contains / not contains predicate, matched against the JSON content of the cell.
The JSON render column options are:
display: viewer display options used in the modal (collapsed,displayObjectSize,objectSortKeys,keyName, …). See the Json widget display options.style: viewer appearance in the modal, as a map of CSS variables with optionallight/darkoverrides. See the Json widget appearance.
{
"name": "JSON",
"render": "JSON",
"position": 8,
"options": {
"display": {
"displayDataTypes": true,
"displayObjectSize": true,
"keyName": "additionalData.json"
},
"style": {
"--w-rjv-font-family": "\"Roboto Mono\", monospace",
"light": {"--w-rjv-type-string-color": "#1b5e20"},
"dark": {"--w-rjv-type-string-color": "#a5d6a7"}
}
}
}