SpreadJS Documentation
createTextLengthValidator Method
GC.Spread.Sheets Namespace > DataValidation type : createTextLengthValidator Method
The type of ComparisonOperators compare operator.
The first object.
The second object.
Creates a validator based on text length.
Syntax
var value; // Type: DefaultDataValidator
value = GC.Spread.Sheets.DataValidation.createTextLengthValidator(typeOperator, v1, v2);
function createTextLengthValidator( 
   typeOperator : ComparisonOperators,
   v1 : object,
   v2 : object
) : DefaultDataValidator;

Parameters

typeOperator
The type of ComparisonOperators compare operator.
v1
The first object.
v2
The second object.

Return Value

The validator.
Example
This example creates a text length validator.
spread.options.highlightInvalidData = true;
var dv = GC.Spread.Sheets.DataValidation.createTextLengthValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan, "4", "20");
dv.showInputMessage(true);
dv.inputMessage("Number of characters must be greater than 4.");
dv.inputTitle("tip");
activeSheet.setDataValidator(1, 1, 1, 1, dv, GC.Spread.Sheets.SheetArea.viewport);
See Also

Reference

DataValidation type