SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / IconSetRule class / icons Method
Sets the iconInfos array.
The custom iconSetType
The custom iconIndex
In This Topic
    icons Method
    In This Topic
    Gets or sets the icons.
    Syntax
    var instance = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(iconSetType, ranges);
    var value; // Type: any
    value = instance.icons(iconInfos, iconInfos.iconSetType, iconInfos.iconIndex);
    function icons( 
       (optional) iconInfos : undefined,
       iconInfos.iconSetType : IconSetType,
       iconInfos.iconIndex : number
    ) : any;

    Parameters

    iconInfos
    Sets the iconInfos array.
    iconInfos.iconSetType
    The custom iconSetType
    iconInfos.iconIndex
    The custom iconIndex

    Return Value

    Returns the iconInfos array.
    Example
    //This example creates a rule.
    activeSheet.setValue(0,0,1,3);
    activeSheet.setValue(1,0,15,3);
    activeSheet.setValue(2,0,25,3);
    activeSheet.setValue(3,0,-1,3);
    
    //rule
    var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule();
    iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]);
    iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights);
    var icons = iconSetRule.icons();
    icons[0] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored, iconIndex: 1};
    icons[1] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored, iconIndex: 2};
    icons[2] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.noIcons, iconIndex: 0};
    iconSetRule.reverseIconOrder(false);
    iconSetRule.showIconOnly(false);
    activeSheet.conditionalFormats.addRule(iconSetRule);
    See Also