SpreadJS Documentation > Developer's Guide > Customizing the Appearance > Using Conditional Formatting > Using the Duplicate Rule |
The duplicate rule checks for duplicate values.
This example creates a duplicate rule.
JavaScript |
Copy Code
|
---|---|
var style = new GcSpread.Sheets.Style(); style.backColor = "yellow"; var rule = new GcSpread.Sheets.DuplicateRule(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); |