ws.formControls
WorksheetFormControls
Form controls sub-API. Values live in linked cells. Creation/update calls mutate the production FormControlManager for the workbook and use this worksheet as the sheet scope.
10 methods
add
→ Promise<CheckboxControl>add(options: AddCheckboxFormControlOptions): Promise<CheckboxControl>;| Parameter | Type | Required |
|---|---|---|
| options | AddCheckboxFormControlOptions | required |
Add a checkbox or comboBox form control on this sheet.
addCheckbox
→ Promise<CheckboxControl>addCheckbox(options: WorksheetCreateCheckboxOptions): Promise<CheckboxControl>;| Parameter | Type | Required |
|---|---|---|
| options | WorksheetCreateCheckboxOptions | required |
Add a checkbox form control on this sheet.
addComboBox
→ Promise<ComboBoxControl>addComboBox(options: WorksheetCreateComboBoxOptions): Promise<ComboBoxControl>;| Parameter | Type | Required |
|---|---|---|
| options | WorksheetCreateComboBoxOptions | required |
Add a comboBox form control on this sheet.
get
→ FormControl | undefinedget(controlId: string): FormControl | undefined;| Parameter | Type | Required |
|---|---|---|
| controlId | string | required |
Get a specific form control by ID. Returns undefined if not found or not on this sheet.
getAtPosition
→ FormControl[]getAtPosition(row: number, col: number): FormControl[];| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
Get form controls at a specific cell position (for hit testing).
update
→ FormControl | undefinedupdate(controlId: string, updates: FormControlUpdate): FormControl | undefined;| Parameter | Type | Required |
|---|---|---|
| controlId | string | required |
| updates | FormControlUpdate | required |
Update a control on this sheet. Returns undefined if the control is absent or on another sheet.
move
→ Promise<FormControl | undefined>move(controlId: string, newAnchor: FormControlAnchorUpdate): Promise<FormControl | undefined>;| Parameter | Type | Required |
|---|---|---|
| controlId | string | required |
| newAnchor | FormControlAnchorUpdate | required |
Move a control on this sheet to a new anchor cell.
resize
→ FormControl | undefinedresize(controlId: string, width: number, height: number): FormControl | undefined;| Parameter | Type | Required |
|---|---|---|
| controlId | string | required |
| width | number | required |
| height | number | required |
Resize a control on this sheet.
remove
→ booleanremove(controlId: string): boolean;| Parameter | Type | Required |
|---|---|---|
| controlId | string | required |
Remove a control from this sheet. Returns true when a control was removed.