SpreadJS Documentation
formula Field
The expected formula.
Syntax
var instance = new GcSpread.Sheets.TextLengthCondition(compareType, expected, formula);
var value; // Type: string
value = instance.formula;
var formula : string;
Example
This example creates a text length condition.
var textLengthCondition = new GcSpread.Sheets.TextLengthCondition();
textLengthCondition.compareType = GcSpread.Sheets.GeneralCompareType.GreaterThan;
textLengthCondition.formula = "$C$1"; // formula used to calculate a number.
var validator = new GcSpread.Sheets.DefaultDataValidator(textLengthCondition)
activeSheet.getCell(0, 0, GcSpread.Sheets.SheetArea.viewport).dataValidator(validator);
spread.highlightInvalidData(true);
activeSheet.setValue(0, 0, "abcf");
 
//Set value 3 to $C$1, after this code, the value in Cell(0,0) is valid.
activeSheet.setValue(0, 2, 3);
//Set value 5 to $C$1, after this code, the value in Cel(0,0) is invalid.
// activeSheet.setValue(0, 2, 5);
See Also

Reference

TextLengthCondition type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.