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
- page (string) - optional, the name of the sheet. If not specified, the method is applied to the current sheet
- clear() - clears all the conditional formatting from the current sheet. Accepts the following parameter:
- page (string) - optional, the name of the sheet. If not specified, the method is applied to 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
- page (string) - optional, the name of the sheet. If not specified, the method is applied to the current sheet
- parse() - parses conditional formattings in the current sheet. Accepts the following parameters:
- data (array) - conditional formatting data where each element is an array like this [rowID, colID, rule, value, css]
- page (string) - optional, the name of the sheet. If not specified, the method is applied to the current sheet
- remove() - removes conditional formatting from a specified cell. Accepts the following parameters:
- row (number) - row ID
- col (number) - col ID
- page (string) - optional, the name of the sheet. If not specified, the method is applied to the current sheet
- serialize() - returns a 2D array analogous to the one described in the parse() method. Accepts the following parameter:
- page (string) - optional, the name of the sheet. If not specified, the method is applied to the current sheet
- 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]
- page (string) - optional, the name of the sheet. If not specified, the method is applied to the current sheet
See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support,
connect with other developers, and share your feedback there.