SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / ConditionalFormats type / 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 GC.Spread.Sheets.Range.
In This Topic
    addSpecificTextRule Method
    In This Topic
    Adds the text rule to the rule collection.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats(worksheet);
    var value; // Type: ConditionRuleBase
    value = instance.addSpecificTextRule(comparisonOperator, text, style, ranges);
    function addSpecificTextRule( 
       comparisonOperator : TextComparisonOperators,
       text : string,
       style : Style,
       ranges : undefined
    ) : ConditionRuleBase;

    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 GC.Spread.Sheets.Range.

    Return Value

    The text rule added to the rule collection.
    Example
    This example uses the addSpecificTextRule method.
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "red";
    var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)];
    activeSheet.conditionalFormats.addSpecificTextRule(GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains, "test", style, ranges);
    activeSheet.setValue(0, 0, "testing");
    activeSheet.setValue(1, 0, "test");
    activeSheet.setValue(2, 0, "a");
    activeSheet.setValue(3, 0, "t");
    See Also