@univerjs/facade v0.4.2 • Docs
Class: FDataValidation
Constructors
new FDataValidation()
new FDataValidation(rule, worksheet?): FDataValidation
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
worksheet ? | FWorksheet |
Returns
Defined in
submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:30 (opens in a new tab)
Properties
Property | Type | Defined in |
---|---|---|
rule | IDataValidationRule | submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:27 (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
A new FDataValidationBuilder instance with the same rule configuration.
Defined in
submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:77 (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:40 (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:86 (opens in a new tab)
getCriteriaType()
getCriteriaType(): DataValidationType
Gets the data validation type of the rule
Returns
The data validation type
Defined in
submodules/univer/packages/facade/src/apis/sheets/f-data-validation.ts:49 (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:58 (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:67 (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:105 (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:137 (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:128 (opens in a new tab)
setCriteria()
setCriteria(type, values): boolean
Set Criteria for the data validation rule.
Parameters
Parameter | Type | Description |
---|---|---|
type | DataValidationType | The 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:147 (opens in a new tab)
setOptions()
setOptions(options): boolean
Set the options for the data validation rule. For details of options, please refer to https://univer.ai/typedoc/@univerjs/core/interfaces/IDataValidationRuleOptions (opens in a new tab)
Parameters
Parameter | Type | Description |
---|---|---|
options | Partial <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
Parameter | Type | Description |
---|---|---|
ranges | FRange [] | 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)