SpreadJS Documentation
createNumberValidator Method
The type of ComparisonOperator compare operator.
The first object.
The second object.
Set to true if the validator is set to a number.
Creates a validator based on numbers.
Syntax
var value; // Type: DefaultDataValidator
value = GcSpread.Sheets.DefaultDataValidator.createNumberValidator(typeOperator, v1, v2, isIntegerValue);
function createNumberValidator( 
   typeOperator : ComparisonOperator,
   v1 : object,
   v2 : object,
   isIntegerValue : boolean
) : DefaultDataValidator;

Parameters

typeOperator
The type of ComparisonOperator compare operator.
v1
The first object.
v2
The second object.
isIntegerValue
Set to true if the validator is set to a number.

Return Value

The validator.
Example
This example creates a number validator.
spread.highlightInvalidData(true);
var dv = GcSpread.Sheets.DefaultDataValidator.createNumberValidator(GcSpread.Sheets.ComparisonOperator.Between, "5", "20", true);
dv.showInputMessage = true;
dv.inputMessage = "Value must be between 5 and 20.";
dv.inputTitle = "tip";
activeSheet.setDataValidator(1, 1, dv);
See Also

Reference

DefaultDataValidator type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.