SpreadJS Documentation > Developer's Guide > Customizing the Appearance > Using Conditional Formatting > Using the Specific Text Rule |
The specific text rule searches for text strings.
This example creates a specific text rule.
JavaScript |
Copy Code
|
---|---|
var style = new GcSpread.Sheets.Style(); style.backColor = "red"; var rule = new GcSpread.Sheets.SpecificTextRule(GcSpread.Sheets.TextComparisonOperator.Contains,"test",style); rule.ranges=[new GcSpread.Sheets.Range(0,0,10,1)]; activeSheet.getConditionalFormats().addRule(rule); activeSheet.setValue(0, 0, "testing"); activeSheet.setValue(1, 0, "test"); activeSheet.setValue(2, 0, "a"); activeSheet.setValue(3, 0, "t"); |