SpreadJS Documentation
containsRule Method
The rule for which to check.
The row index.
The column index.
Determines whether the specified cell contains a specified rule.
Syntax
var instance = new GcSpread.Sheets.ConditionalFormats(worksheet);
var value; // Type: boolean
value = instance.containsRule(rule, row, column);
function containsRule( 
   rule : object,
   row : number,
   column : number
) : boolean;

Parameters

rule
The rule for which to check.
row
The row index.
column
The column index.

Return Value

true if the specified cell contains a specified rule; otherwise, false.
Example
This example checks to see if a cell has a specified rule.
var style = new GcSpread.Sheets.Style();
style.backColor = "red";
var rule = new GcSpread.Sheets.CellValueRule(GcSpread.Sheets.ComparisonOperator.Between,2,100,style);
rule.ranges=[new GcSpread.Sheets.Range(0,0,5,1)];
activeSheet.getConditionalFormats().addRule(rule);
activeSheet.setValue(0,0,1,3);
activeSheet.setValue(1,0,45,3);
var ruletest = activeSheet.getConditionalFormats().containsRule(rule, 0, 0);
alert(ruletest);
See Also

Reference

ConditionalFormats type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.