SpreadJS Documentation > Developer's Guide > Customizing the Appearance > Using Conditional Formatting > Using the Unique Rule |
The unique rule checks to see if the value is the only one of that value in the range.
This example creates a unique rule.
JavaScript |
Copy Code
|
---|---|
var style = new GcSpread.Sheets.Style(); style.backColor = "green"; var rule = new GcSpread.Sheets.UniqueRule(style); rule.ranges=[new GcSpread.Sheets.Range(0,0,10,1)]; activeSheet.getConditionalFormats().addRule(rule); activeSheet.setValue(0, 0, 50); activeSheet.setValue(1, 0, 50); activeSheet.setValue(2, 0, 11); activeSheet.setValue(3, 0, 5); |