Stay organized with collections
Save and categorize content based on your preferences.
blockly > inputs > Input > insertFieldAt
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
Parameter |
Type |
Description |
index |
number |
The index at which to insert field. |
field |
string | Field<T> |
Something to add as a field. |
opt_name |
string |
(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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `insertFieldAt()` method adds a field or label to a specific position within a block's input row."],["It accepts an index to specify the insertion point, the field or label to insert, and an optional name for the field."],["The method returns the index of the position after the newly inserted field."]]],[]]