AI-generated Key Takeaways
-
There are two ways to access a category programmatically: by index or by ID.
-
Accessing by index uses
toolbox.getToolboxItems()[index]
. -
Accessing by ID uses
toolbox.getToolboxItemById('categoryId')
. -
The ID is specified in the toolbox definition using the
toolboxitemid
property for JSON or thetoolboxitemid
attribute for XML.
There are two ways you can access a category programmatically. You can either access it by index (where 0 is the top category):
var category = toolbox.getToolboxItems()[0];
Or by ID:
var category = toolbox.getToolboxItemById('categoryId');
Where the ID is specified in the toolbox definition:
JSON
{
"kind": "category",
"name": "...",
"toolboxitemid": "categoryId"
}
XML
<category name="..." toolboxitemid="categoryId"></category>