conditions

a module for working with conditions

object conditions;

Example

$$("ss").conditions.parse([
  [3, 3, "greater", 5000, "webix_ssheet_condition_good"],
  [3, 3, "lessOrEqual", 5000, "webix_ssheet_condition_bad"],
  [4, 4, "less", 100, "webix_ssheet_condition_bad"]
]);

Related samples

Details

The module has several methods to work with conditions:

  • handlers() - returns all the conditions
  • add() - adds conditional formatting for a specified cell. Accepts the following parameters:
    • row (number) - row ID
    • col (number) - col ID.
    • rule (string) - conditional rule
    • value (value) - value to compare with
    • css (string) - CSS class name to apply
  • clear() - clears all the conditional formatting from the current sheet
  • get() - returns an array of all the conditional formattings of a specified cell. Accepts the following parameters:
    • row (number) - row ID
    • col (number) - col ID.
  • parse() - parses conditional formattings in the current sheet. Accepts a single parameter:
    • data (array) - conditional formatting data where each element is an array like this [rowID, colID, rule, value, css].
  • remove() - removes conditional formatting from a specified cell. Accepts two parameters:
    • row (number) - row ID
    • col (number) - col ID.
  • seialize() - returns a 2D array analogous to the one described in the parse() method
  • update() - updates conditional formatting of a specified cell. Accepts the following parameters:
    • row (number) - row ID
    • col (number) - col ID
    • newData (array) - 2D array like this [rule, value, css].
See also
Back to top