[]
        
(Showing Draft Content)

GC.Spread.Sheets.DataValidation

Namespace: DataValidation

Spread.Sheets.DataValidation

Table of contents

Enumerations

Classes

Functions

Functions

createDateValidator

createDateValidator(typeOperator, v1, v2): DefaultDataValidator

Creates a validator based on the data.

static

example

spread.options.highlightInvalidData = true;
var dv = GC.Spread.Sheets.DataValidation.createDateValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, new Date(2012, 11, 31), new Date(2013, 11, 31));
dv.showInputMessage(true);
dv.inputMessage("Enter a date between 12/31/2012 and 12/31/2013.");
dv.inputTitle("Tip");
activeSheet.getCell(1, -1).validator(dv);

Parameters

Name Type Description
typeOperator ComparisonOperators The type of ComparisonOperators compare operator.
v1 Object The first object.
v2 Object The second object.

Returns

DefaultDataValidator

The validator.


createFormulaListValidator

createFormulaListValidator(formula): DefaultDataValidator

Creates a validator based on a formula list.

static

example

activeSheet.setValue(0, 2, 5);
activeSheet.setValue(1, 2, 4);
activeSheet.setValue(2, 2, 5);
spread.options.highlightInvalidData = true;
var dv = GC.Spread.Sheets.DataValidation.createFormulaListValidator("$C$1:$C$3");
dv.showInputMessage(true);
dv.inputMessage("Pick a value from the list.");
dv.inputTitle("tip");
activeSheet.setDataValidator(1, 1, 1,1,dv,GC.Spread.Sheets.SheetArea.viewport);
var validList = activeSheet.getDataValidator(1, 1).getValidList(activeSheet, 1, 1);
alert(validList);

Parameters

Name Type Description
formula string The formula list.

Returns

DefaultDataValidator

The validator.


createFormulaValidator

createFormulaValidator(formula): DefaultDataValidator

Creates a validator based on a formula.

static

example

spread.options.highlightInvalidData = true;
//The formula validator is valid if the formula condition returns true.
var dv = GC.Spread.Sheets.DataValidation.createFormulaValidator("A1>0");
dv.showInputMessage(true);
dv.inputMessage("Enter a value greater than 0 in A1.");
dv.inputTitle("Tip");
activeSheet.setDataValidator(0, 0, 1,1,dv,GC.Spread.Sheets.SheetArea.viewport);

Parameters

Name Type Description
formula string The formula condition.

Returns

DefaultDataValidator

The validator.


createListValidator

createListValidator(source): DefaultDataValidator

Creates a validator based on a list.

static

example

spread.options.highlightInvalidData = true;
var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3");
dv.showInputMessage(true);
dv.inputMessage("Value must be 1,2 or 3");
dv.inputTitle("tip");
activeSheet.setDataValidator(1,1,1,1,dv, GC.Spread.Sheets.SheetArea.viewport);
alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1));

Parameters

Name Type Description
source string The list value.

Returns

DefaultDataValidator

The validator.


createNumberValidator

createNumberValidator(typeOperator, v1, v2, isIntegerValue): DefaultDataValidator

Creates a validator based on numbers.

static

example

spread.options.highlightInvalidData = true;
var dv = GC.Spread.Sheets.DataValidation.createNumberValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, "5", "20", true);
dv.showInputMessage(true);
dv.inputMessage("Value must be between 5 and 20.");
dv.inputTitle("tip");
activeSheet.setDataValidator(1, 1, 1,1,dv,GC.Spread.Sheets.SheetArea.viewport);

Parameters

Name Type Description
typeOperator ComparisonOperators The type of ComparisonOperators compare operator.
v1 Object The first object.
v2 Object The second object.
isIntegerValue boolean Set to true if the validator is set to a number.

Returns

DefaultDataValidator

The validator.


createTextLengthValidator

createTextLengthValidator(typeOperator, v1, v2): DefaultDataValidator

Creates a validator based on text length.

static

example

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);

Parameters

Name Type Description
typeOperator ComparisonOperators The type of ComparisonOperators compare operator.
v1 Object The first object.
v2 Object The second object.

Returns

DefaultDataValidator

The validator.


createTimeValidator

createTimeValidator(typeOperator, v1, v2): DefaultDataValidator

Creates a validator based on the time.

static

example

spread.options.highlightInvalidData = true;
var dv = GC.Spread.Sheets.DataValidation.createTimeValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, '9:08:09', '19:08:09');
dv.showInputMessage(true);
dv.inputMessage("Enter a time between 9:08:09 and 19:08:09.");
dv.inputTitle("Tip");
sheet.setDataValidator(1, 1, dv);

Parameters

Name Type Description
typeOperator ComparisonOperators The type of ComparisonOperators compare operator.
v1 Object The first object.
v2 Object The second object.

Returns

DefaultDataValidator

The validator.