SpreadJS Documentation
addFormulaRule Method
The condition formula.
The style that is applied to the cell when the condition is met.
The cell ranges where the rule is applied whose item type is GcSpread.Sheets.Range.
Adds the formula rule to the rule collection.
Syntax
var instance = new GcSpread.Sheets.ConditionalFormats(worksheet);
var value; // Type: object
value = instance.addFormulaRule(formula, style, ranges);
function addFormulaRule( 
   formula : string,
   style : Style,
   ranges : Array
) : object;

Parameters

formula
The condition formula.
style
The style that is applied to the cell when the condition is met.
ranges
The cell ranges where the rule is applied whose item type is GcSpread.Sheets.Range.

Return Value

The formula rule added to the rule collection.
Example
This example uses the addFormulaRule method.
var style = new GcSpread.Sheets.Style();
style.backColor = "red";
activeSheet.setValue(0, 0, 2,3);
activeSheet.setValue(0, 1, 1,3);
activeSheet.setValue(0, 2,1,3);
activeSheet.setValue(1, 0, 1,3);
activeSheet.getConditionalFormats().addFormulaRule("=A1=B1+C1", style, [new GcSpread.Sheets.Range(0, 0, 5, 1) ]);
See Also

Reference

ConditionalFormats type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.