SpreadJS Documentation
ColorCondition Constructor
The style comparison type.
The expected color.
Represents a style condition with the specified comparison type and expected color.
Syntax
var instance = new GcSpread.Sheets.ColorCondition(compareType, expected);
function ColorCondition( 
   compareType : ColorCompareType,
   expected : string
) : ColorCondition;

Parameters

compareType
The style comparison type.
expected
The expected color.
Example
This example filters using colors.
activeSheet.isPaintSuspended(true);
var rowFilter = new GcSpread.Sheets.HideRowFilter(new GcSpread.Sheets.Range(-1, 0, -1, 1));
activeSheet.rowFilter(rowFilter);
activeSheet.getCell(0, 0).value("A1").backColor("blue");
activeSheet.getCell(1, 0).value("A2").backColor("yellow");
activeSheet.getCell(2, 0).value("A3").backColor("red");
activeSheet.getCell(3, 0).value("A4").backColor("green");
activeSheet.getCell(4, 0).value("A5").backColor("yellow");
var nCondition = new GcSpread.Sheets.ColorCondition(GcSpread.Sheets.ColorCompareType.BackgroundColor, "yellow");
var filter = activeSheet.rowFilter();
filter.addFilterItem(0, nCondition);
filter.filter(0);
activeSheet.isPaintSuspended(false);
See Also

Reference

ColorCondition type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.