<< 点击显示目录 >> 主页 mappView帮助助手 > mapp View帮助信息 > Widgets > Data > Table > Concept > Filter configuration |
This section explains the composition of string filterConfiguration.
"[{"value":0,"conditionType":"==","columnPosition":0}]"
When creating filter criteria, the string contains three components: The value, the condition type and the column position.
If the value is a "string", the value must be enclosed by quotation marks (" "). If it is a "number", the value should not be enclosed in quotation marks.
conditionType specifies the comparison operations with which the filter is performed.
The following values are available for this: "<>", "==", "<", "<=", "=>", ">", "Contains", "Does not contain".
Values "Contains" and "Does not contain" work with string comparison. It must thus be ensured that a string binding is used.
columnPosition specifies the numerical position of the element in the list.
Since this is the complete list of table elements, it is important to pay attention to hidden positions.
"[{"logicalOperator":"and","value":"high","conditionType":"Does not contain","columnPosition":3},{"value":0,"conditionType":"<>","columnPosition":0}]"
This extended filter consists of two elements.
When using multiple criteria, logicalOperator must be applied.
This combines the criteria with each other. An AND or OR operator can be used for this.
The last element does not contain a logical operator and looks like a single element.
This means that if more elements should be added, the logical operators must be added to the first of these two elements. The last element (without the logical operator) is then added.
The following example includes multiple logical operators:
"[{"logicalOperator":"and","value":"high","conditionType":"Does not contain","columnPosition":3},{"logicalOperator":"or","value":0,"conditionType":"<>","columnPosition":0},{"value":"2021-09-14T13:49:22.000Z","conditionType":"<","columnPosition":1}]"
If a date or time should be compared, ISO standard 8601 must be observed.
The t separates the date from the time and the z at the end indicates UTC. The time should still be specified in local time and not converted to UTC, however.
The local time must be selected and a z added at the end.
For Hanoi time zone (GMT +7), the current time 20202-09-10T14: 18: 01,000 is used and only a z is added, for example. The time zone is left out.
Example: 20202-09-10T14:18:01.000Z
The finished filter criteria is a JSON string. Whether the specified filter is correct can be checked on the following page: JSON string validation.
If it appears green, it means that the JSON string is okay. If it appears red, it will not work in the widget.
Attention: Only double quotation marks should be used.