SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / ConditionalFormats type / addUniqueRule Method
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
    addUniqueRule Method
    In This Topic
    Adds a unique rule to the rule collection.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats(worksheet);
    var value; // Type: ConditionRuleBase
    value = instance.addUniqueRule(style, ranges);
    function addUniqueRule( 
       style : Style,
       ranges : undefined
    ) : ConditionRuleBase;

    Parameters

    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 unique rule added to the rule collection.
    Example
    This example uses the addUniqueRule method.
    var style = new GC.Spread.Sheets.Style(); 
    style.backColor = "green"; 
    activeSheet.setValue(0, 0, 50); 
    activeSheet.setValue(1, 0, 50); 
    activeSheet.setValue(2, 0, 11); 
    activeSheet.setValue(3, 0, 5);
    activeSheet.conditionalFormats.addUniqueRule(style, [new GC.Spread.Sheets.Range(0,0,10,1)]);
    See Also