Skip to content

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>;
ParameterTypeRequired
optionsAddCheckboxFormControlOptionsrequired

Add a checkbox or comboBox form control on this sheet.

addCheckbox

Promise<CheckboxControl>
addCheckbox(options: WorksheetCreateCheckboxOptions): Promise<CheckboxControl>;
ParameterTypeRequired
optionsWorksheetCreateCheckboxOptionsrequired

Add a checkbox form control on this sheet.

addComboBox

Promise<ComboBoxControl>
addComboBox(options: WorksheetCreateComboBoxOptions): Promise<ComboBoxControl>;
ParameterTypeRequired
optionsWorksheetCreateComboBoxOptionsrequired

Add a comboBox form control on this sheet.

list

FormControl[]
list(): FormControl[];

Get all form controls on this sheet.

get

FormControl | undefined
get(controlId: string): FormControl | undefined;
ParameterTypeRequired
controlIdstringrequired

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[];
ParameterTypeRequired
rownumberrequired
colnumberrequired

Get form controls at a specific cell position (for hit testing).

update

FormControl | undefined
update(controlId: string, updates: FormControlUpdate): FormControl | undefined;
ParameterTypeRequired
controlIdstringrequired
updatesFormControlUpdaterequired

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>;
ParameterTypeRequired
controlIdstringrequired
newAnchorFormControlAnchorUpdaterequired

Move a control on this sheet to a new anchor cell.

resize

FormControl | undefined
resize(controlId: string, width: number, height: number): FormControl | undefined;
ParameterTypeRequired
controlIdstringrequired
widthnumberrequired
heightnumberrequired

Resize a control on this sheet.

remove

boolean
remove(controlId: string): boolean;
ParameterTypeRequired
controlIdstringrequired

Remove a control from this sheet. Returns true when a control was removed.