conditions

defines a custom set of filtering rules

array conditions;

Example

{
    view:"filter",
    type:"number",
    field:"year",
    conditions:[
        {id: ">", value: "greater", handler: (a, b) => a > b },
        {id: "<", value: "less", handler: (a, b) => a < b },
        {id: ">=", value: "greater or equal", handler: (a, b) => a >= b },
        {id: "<=", value: "less or equal", handler: (a, b) => a <= b }
    ]
    // ...
}

Details

Each object in the conditions array contains these properties:

  • id (string,number) the filter ID;
  • value (string) the name of the rule;
  • handler (function) the filtering function.

A custom set of filtering rules applies only to types "number" and "text".

See also
  • API
  • Articles
  • Back to top