API Reference
@univerjs
@univerjs/facade
classes
Fdatavalidation

@univerjs/facade v0.2.14Docs


Class: FDataValidation

Constructors

new FDataValidation()

new FDataValidation(rule, worksheet?): FDataValidation

Parameters

ParameterType
ruleIDataValidationRule
worksheet?FWorksheet

Returns

FDataValidation

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:31 (opens in a new tab)

Properties

PropertyTypeDefined in
ruleIDataValidationRulesubmodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:28 (opens in a new tab)

Methods

copy()

copy(): FDataValidationBuilder

Creates a new instance of FDataValidationBuilder using the current rule object. This method is useful for copying an existing data validation rule configuration.

Returns

FDataValidationBuilder

A new FDataValidationBuilder instance with the same rule configuration.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:78 (opens in a new tab)


delete()

delete(): boolean

Delete the data validation rule from the worksheet.

Returns

boolean

true if the rule is deleted successfully, false otherwise.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:231 (opens in a new tab)


getAllowInvalid()

getAllowInvalid(): boolean

Gets whether invalid data is allowed based on the error style value.

Returns

boolean

true if invalid data is allowed, false otherwise.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:41 (opens in a new tab)


getApplied()

getApplied(): boolean

Gets whether the data validation rule is applied to the worksheet.

Returns

boolean

true if the rule is applied, false otherwise.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:87 (opens in a new tab)


getCriteriaType()

getCriteriaType(): DataValidationType

Gets the data validation type of the rule

Returns

DataValidationType

The data validation type

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:50 (opens in a new tab)


getCriteriaValues()

getCriteriaValues(): (undefined | string)[]

Gets the values used for criteria evaluation

Returns

(undefined | string)[]

An array containing the operator, formula1, and formula2 values

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:59 (opens in a new tab)


getHelpText()

getHelpText(): undefined | string

Gets the help text information, which is used to provide users with guidance and support

Returns

undefined | string

Returns the help text information. If there is no error message, it returns an undefined value.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:68 (opens in a new tab)


getRanges()

getRanges(): FRange[]

Gets the ranges to which the data validation rule is applied.

Returns

FRange[]

An array of IRange objects representing the ranges to which the data validation rule is applied.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:106 (opens in a new tab)


getSheetId()

getSheetId(): undefined | string

Gets the sheetId of the worksheet.

Returns

undefined | string

The sheetId of the worksheet.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:138 (opens in a new tab)


getUnitId()

getUnitId(): undefined | string

Gets the title of the error message dialog box.

Returns

undefined | string

The title of the error message dialog box.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:129 (opens in a new tab)


setCriteria()

setCriteria(type, values): boolean

Set Criteria for the data validation rule.

Parameters

ParameterTypeDescription
typeDataValidationTypeThe type of data validation criteria.
values[DataValidationOperator, string, string]An array containing the operator, formula1, and formula2 values.

Returns

boolean

true if the criteria is set successfully, false otherwise.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:148 (opens in a new tab)


setOptions()

setOptions(options): boolean

Set the options for the data validation rule.

Parameters

ParameterTypeDescription
optionsPartial<IDataValidationRuleOptions>An object containing the options to set. IDataValidationRuleOptions

Returns

boolean

true if the options are set successfully, false otherwise.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:181 (opens in a new tab)


setRanges()

setRanges(ranges): boolean

Set the ranges to the data validation rule.

Parameters

ParameterTypeDescription
rangesFRange[]new ranges array.

Returns

boolean

true if the ranges are set successfully, false otherwise.

Defined in

submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:208 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.