SpreadJS Documentation
addDateOccurringRule Method
The data occurring type.
The style that is applied to the cell when the condition is met.
The cell ranges where the rule is applied whose item type is GcSpread.Sheets.Range.
Adds the date occurring rule to the rule collection.
Syntax
var instance = new GcSpread.Sheets.ConditionalFormats(worksheet);
var value; // Type: object
value = instance.addDateOccurringRule(type, style, ranges);
function addDateOccurringRule( 
   type : DateOccurringType,
   style : Style,
   ranges : Array
) : object;

Parameters

type
The data occurring type.
style
The style that is applied to the cell when the condition is met.
ranges
The cell ranges where the rule is applied whose item type is GcSpread.Sheets.Range.

Return Value

The date occurring rule added to the rule collection.
Example
This example uses the addDateOccurringRule method.
var style = new GcSpread.Sheets.Style();
style.backColor = "red";

var d = new Date();
activeSheet.setValue(0, 0, d);
activeSheet.setValue(1, 0, new Date(d.setDate(d.getDate()+1)));
activeSheet.setValue(2, 0, new Date(d.setDate(d.getDate()+5)));
activeSheet.setValue(3, 0,new Date(d.setDate(d.getDate()+6)));
activeSheet.setValue(4, 0,new Date(d.setDate(d.getDate()+7)));
activeSheet.setValue(5, 0, new Date(d.setDate(d.getDate()+8)));

activeSheet.getConditionalFormats().addDateOccurringRule(GcSpread.Sheets.DateOccurringType.NextWeek, style, [new GcSpread.Sheets.Range(0,0,10,1)]);
See Also

Reference

ConditionalFormats type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.