SpreadJS Documentation
addCellValueRule Method
The comparison operator.
The first value.
The second value.
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 GcSpread.Sheets.Range.
Adds the cell value rule to the rule collection.
Syntax
var instance = new GcSpread.Sheets.ConditionalFormats(worksheet);
var value; // Type: object
value = instance.addCellValueRule(comparisonOperator, value1, value2, style, ranges);
function addCellValueRule( 
   comparisonOperator : ComparisonOperator,
   value1 : object,
   value2 : object,
   style : Style,
   ranges : Array
) : object;

Parameters

comparisonOperator
The comparison operator.
value1
The first value.
value2
The second value.
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 GcSpread.Sheets.Range.

Return Value

The cell value rule added to the rule collection.
Example
This example uses the addCellValueRule method.
var style = new GcSpread.Sheets.Style();
style.backColor = "red";
activeSheet.setValue(0,0,1,3);
activeSheet.setValue(1,0,45,3);
activeSheet.getConditionalFormats().addCellValueRule(GcSpread.Sheets.ComparisonOperator.Between, 2, 200, style, [new GcSpread.Sheets.Range(0,0,5,1)]);
See Also

Reference

ConditionalFormats type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.