SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / NormalConditionRule class / text Method
The text for comparison.
In This Topic
    text Method
    In This Topic
    Gets or sets the text for comparison.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(ruleType, ranges, style, operator, value1, value2, text, formula, type, rank);
    var returnValue; // Type: any
    returnValue = instance.text(value);
    function text( 
       value : string
    ) : any;

    Parameters

    value
    The text for comparison.

    Return Value

    If no value is set, returns the text for comparison; otherwise, returns the number condition rule.
    Example
    This example creates a rule.
    var style = new GC.Spread.Sheets.Style();
    style.backColor = "red";
    var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
    rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule);
    rule.style(style);
    rule.text("test");
    rule.operator(GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains);
    rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
    activeSheet.conditionalFormats.addRule(rule);
    activeSheet.setValue(0, 0, "testing");
    activeSheet.setValue(1, 0, "test");
    activeSheet.setValue(2, 0, "a");
    activeSheet.setValue(3, 0, "t");
    See Also