SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / ConditionalFormats type / addDuplicateRule 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
    addDuplicateRule Method
    In This Topic
    Adds a duplicate rule to the rule collection.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats(worksheet);
    var value; // Type: ConditionRuleBase
    value = instance.addDuplicateRule(style, ranges);
    function addDuplicateRule( 
       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 duplicate rule added to the rule collection.
    Example
    This example uses the addDuplicateRule method.
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "yellow";
    var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)];
    activeSheet.conditionalFormats.addDuplicateRule(style, ranges);
    activeSheet.setValue(0, 0, 50);
    activeSheet.setValue(1, 0, 50);
    activeSheet.setValue(2, 0, 11);
    activeSheet.setValue(3, 0, 5);
    See Also