SpreadJS Documentation
addSpecificTextRule Method
The comparison operator.
The text for comparison.
The style that is applied to the cell when the condition is met.
The cell ranges where the rule is applied to items whose item type is GcSpread.Sheets.Range.
Adds the text rule to the rule collection.
Syntax
var instance = new GcSpread.Sheets.ConditionalFormats(worksheet);
var value; // Type: object
value = instance.addSpecificTextRule(comparisonOperator, text, style, ranges);
function addSpecificTextRule( 
   comparisonOperator : TextComparisonOperator,
   text : string,
   style : Style,
   ranges : Array
) : object;

Parameters

comparisonOperator
The comparison operator.
text
The text for comparison.
style
The style that is applied to the cell when the condition is met.
ranges
The cell ranges where the rule is applied to items whose item type is GcSpread.Sheets.Range.

Return Value

The text rule added to the rule collection.
Example
This example uses the addSpecificTextRule method.
var style = new GcSpread.Sheets.Style();
style.backColor = "red";
activeSheet.setValue(0, 0, "testing");
activeSheet.setValue(1, 0, "test");
activeSheet.setValue(2, 0, "a");
activeSheet.setValue(3, 0, "t");
activeSheet.getConditionalFormats().addSpecificTextRule(GcSpread.Sheets.TextComparisonOperator.Contains, "test", style, [new GcSpread.Sheets.Range(0,0,10,1)]);
See Also

Reference

ConditionalFormats type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.