SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / NormalConditionRule class / reset Method
In This Topic
    reset Method
    In This Topic
    Resets the rule.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(ruleType, ranges, style, operator, value1, value2, text, formula, type, rank);
    var value; // Type: any
    value = instance.reset();
    function reset() : any;
    Example
    The following examples use the reset method.
    activeSheet.setValue(0,0, 1,3);
    activeSheet.setValue(1,0, 50,3);
    activeSheet.setValue(2,0, 100,3);
    activeSheet.setValue(3,0, 2,3);
    activeSheet.setValue(4,0, 60,3);
    activeSheet.setValue(5,0, 90,3);
    activeSheet.setValue(6,0, 3,3);
    activeSheet.setValue(7,0, 40,3);
    activeSheet.setValue(8,0, 70,3);
    activeSheet.setValue(9,0, 5,3);
    activeSheet.setValue(10,0, 35,3);
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "red";
    style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
    style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
    style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
    style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
    var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
    rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule);
    rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]);
    rule.style(style);
    rule.type(GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above);
    activeSheet.conditionalFormats.addRule(rule);
    rule.reset();
    <input type="button" id="button1" value="button1"/>
    
    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.formulaRule);
    rule.formula("=A1=B1+C1");
    rule.ranges([new GC.Spread.Sheets.Range(0, 0, 5, 1)]);
    rule.style(style);
    activeSheet.conditionalFormats.addRule(rule);
    activeSheet.setValue(0, 0, 2,3);
    activeSheet.setValue(0, 1, 1,3);
    activeSheet.setValue(0, 2,1,3);
    activeSheet.setValue(1, 0, 1,3); 
    
    $("#button1").click(function () {
    activeSheet.suspendPaint();
    rule.reset();
    activeSheet.resumePaint();
        });
    <input type="button" id="button1" value="button1"/>
    
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "red";
    var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule, [new GC.Spread.Sheets.Range(0,0,10,1)], style, null, null, null, null, null, GC.Spread.Sheets.ConditionalFormatting.DateOccurringType.nextWeek);
    activeSheet.conditionalFormats.addRule(rule);
    var d = new Date();
    activeSheet.setValue(0, 0, d);
    activeSheet.setValue(1, 0, new Date(d.setDate(d.getDate()+1)));
    activeSheet.setValue(2, 0, new Date(d.setDate(d.getDate()+5)));
    activeSheet.setValue(3, 0,new Date(d.setDate(d.getDate()+6)));
    activeSheet.setValue(4, 0,new Date(d.setDate(d.getDate()+7)));
    activeSheet.setValue(5, 0, new Date(d.setDate(d.getDate()+8)));
    
    $("#button1").click(function () {
    activeSheet.suspendPaint();
    rule.reset();
    activeSheet.resumePaint();
        });
    <input type="button" id="button1" value="button1"/>
    
    activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
    var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
    cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
    cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
    cell.value1(5);
    cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "red";
    cell.style(style);
    activeSheet.conditionalFormats.addRule(cell);
    
    $("#button1").click(function () {
    cell.reset();
    activeSheet.suspendPaint();
    activeSheet.resumePaint();
        });
    See Also