SpreadJS Documentation
addRule Method
The rule to add.
Adds the rule.
Syntax
var instance = new GcSpread.Sheets.ConditionalFormats(worksheet);
var value; // Type: object
value = instance.addRule(rule);
function addRule( 
   rule : object
) : object;

Parameters

rule
The rule to add.

Return Value

The rule.
Example
This example uses the addRule method.
var scale = new GcSpread.Sheets.ThreeScaleRule();
scale.setMidpointColor("red");
scale.setMidpointType(0);
scale.setMidpointValue(50);
scale.setMaximumColor("blue");
scale.setMaximumType(2);
scale.setMaximumValue(100);
scale.setMinimumColor("yellow");
scale.setMinimumType(1);
scale.setMinimumValue(10);
scale.ranges = [new GcSpread.Sheets.Range(0, 0, 10, 3)];
activeSheet.getConditionalFormats().addRule(scale);
activeSheet.setValue(0,0, 1,3);
activeSheet.setValue(1,0, 50,3);
activeSheet.setValue(2,0, 100,3);
See Also

Reference

ConditionalFormats type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.