SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / ConditionalFormats type / getRule Method
The index from which to get the rule.
In This Topic
    getRule Method
    In This Topic
    Gets the rule using the index.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats(worksheet);
    var value; // Type: ConditionRuleBase
    value = instance.getRule(index);
    function getRule( 
       index : number
    ) : ConditionRuleBase;

    Parameters

    index
    The index from which to get the rule.

    Return Value

    The rule from the index.
    Example
    This example uses the getRule method.
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "red";
    var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
    rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
    rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]);
    rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between);
    rule.style(style);
    rule.value1(2);
    rule.value2(100);
    activeSheet.conditionalFormats.addRule(rule);
    activeSheet.setValue(0,0,1,3);
    activeSheet.setValue(1,0,45,3);
    var ruletest = activeSheet.conditionalFormats.getRule(0);
    alert(ruletest.value1());
    See Also