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"}
}
}
}
Severity render
A column with the SEVERITY render shows the severity held by a cell and colors the row with it. A view has at most one SEVERITY column. A cell can hold:
a severity level, such as
300, matched against the severities defined in the system;the id of a severity defined in the system;
a severity object, with its own name and colors;
one of the keywords
notice,success,warninganderror.
The keywords take their colors from the theme of the dashboard, in light and dark: notice is blue, success green, warning orange and error red. A severity defined in the system with the same id as a keyword takes precedence. The keywords are not listed in the severity filter of the column.
A severity object shows its name field. To show another field, set its path in options.format, such as label or display.text. The cell shows name when that field is empty. options.format does not apply to a severity level, an id or a keyword.
{
"name": "Priority",
"field": "priority",
"render": "SEVERITY",
"options": {
"format": "label"
}
}
Actions render
A column can use the ACTIONS render to show the entries of one or more menus as buttons on every row. Row buttons explains which entries show and the context they receive.
The actions render column options are:
menuReferences: the ids of the menus to show, in the same format as the widgetmenuReferences. A wrong id is refused when the configuration is pushed.buttonContent: what each button shows.iconAndLabel(default) shows the icon of the entry, then its label.iconshows only the icon, with the label in a tooltip, andlabelonly the label. An entry without icon shows its label whatever the value.
Buttons use the text color of the row for their text, icon and border, so they follow the severity colors of an alarm table.
The journalSettingsOverride.tableView of a journal can declare the column too, in a collection schema view or in a Journal element of a form. Its buttons then show on every journal entry, rows.clicked is that entry, and the menu contexts use the type Journal.
The column has no field and is never sortable or filterable: sortable and filterable default to false, and a configuration that sets a field, sortable: true or filterable: true is refused. In an alarm view, the column is only declared in the view.web file, not in the view properties. The column chooser hides and shows it like any other column. The Excel export skips it, and it is left out of columnOrder and hiddenColumnNames in the menu context, which exports rely on.
{
"name": "Actions",
"render": "ACTIONS",
"position": 0,
"width": "260 px",
"options": {
"menuReferences": ["root.collections.row-actions"],
"buttonContent": "icon"
}
}