Skip to main content

Home > blockly > inputs > Input > insertFieldAt

inputs.Input.insertFieldAt() method

Inserts a field (or label from string), and all prefix and suffix fields, at the location of the input's field row.

Signature:

insertFieldAt<T>(index: number, field: string | Field<T>, opt_name?: string): number;

Parameters

ParameterTypeDescription
indexnumberThe index at which to insert field.
fieldstring | Field<T>Something to add as a field.
opt_namestring(Optional) Language-neutral identifier which may used to find this field again. Should be unique to the host block.

Returns:

number

The index following the last inserted field.