blockly > Toolbox > getToolboxItemById
Gets the toolbox item with the given ID.
Signature:
getToolboxItemById(id: string): IToolboxItem | null;
Parameters
Parameter |
Type |
Description |
id |
string |
The ID of the toolbox item. |
Returns:
IToolboxItem | null
The toolbox item with the given ID, or null if no item exists.
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.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `Toolbox.getToolboxItemById()` method retrieves a toolbox item using its unique ID."],["It accepts a single parameter: `id` (string) representing the ID of the desired toolbox item."],["This method returns the `IToolboxItem` object if found, otherwise it returns `null`."]]],[]]