Survey Creator Toolbox Categories
The Toolbox is a UI element that displays available question and panel types. To add a question or panel to your survey, simply click it in the Toolbox or drag and drop the desired survey element onto the design surface. This example shows how to arrange questions and panels in the Toolbox into multiple categories. Read more...
The Toolbox is a UI element that displays available question and panel types. To add a question or panel to your survey, simply click it in the Toolbox or drag and drop the desired survey element onto the design surface. This example shows how to arrange questions and panels in the Toolbox into multiple categories.
Note that the Toolbox displays categories only in full display mode. This mode is enabled automatically when Survey Creator has sufficient width. If you want to use the full mode at all times, set the
forceCompact property to
To organize toolbox items into categories, use the
defineCategories(categories, displayMisc) method. This method accepts an array of objects as the
categories parameter. Each object defines a single category and lists items included into it. Unlisted items can be collected in the Misc category if you pass
true as the
displayMisc parameter. Optionally, you can override display titles for individual items. Refer to the
defineCategories method call in the code for an example.
You can also use localization capabilities to change the caption of the Misc category. This demo shows how to rename the Misc category to "Other Questions". Note that the code that changes the caption should go before the code that instantiates Survey Creator.
Toolbox categories do not show their titles by default. Instead, the categories are separated one from another by a delimiter. If you want to display category titles, enable Toolbox's
Created categories are stored in the
categories array of the Toolbox. You can access and modify this array if you want to reorder categories at runtime.
The Toolbox also has the following properties to control the behavior of categories:
Allows users to expand more than one category at a time. If this property is
false, the currently expanded category collapses when a user expands another category.
Expands all categories. Users cannot collapse them.
Since these two properties are incompatible with each other, this example demonstrates only the