SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / ConditionalFormats type / addCellValueRule Method
The comparison operator.
The first value.
The second value.
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 GC.Spread.Sheets.Range.
In This Topic
    addCellValueRule Method
    In This Topic
    Adds the cell value rule to the rule collection.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats(worksheet);
    var value; // Type: ConditionRuleBase
    value = instance.addCellValueRule(comparisionOperator, value1, value2, style, ranges);
    function addCellValueRule( 
       comparisionOperator : ComparisonOperators,
       value1 : Object,
       value2 : Object,
       style : Style,
       ranges : undefined
    ) : ConditionRuleBase;

    Parameters

    comparisionOperator
    The comparison operator.
    value1
    The first value.
    value2
    The second value.
    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 GC.Spread.Sheets.Range.

    Return Value

    The cell value rule added to the rule collection.
    Example
    This example uses the addCellValueRule method.
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "red";
    var ranges=[new GC.Spread.Sheets.Range(0,0,5,1)];
    activeSheet.conditionalFormats.addCellValueRule(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, 2, 100, style, ranges);
    activeSheet.setValue(0,0,1,3);
    activeSheet.setValue(1,0,45,3); 
    See Also