Documentation Docs
Documentation Docs

QuestionToolbox

The list of Toolbox items.

activeCategory property

Set and get and active category. This property doesn't work if allowExpandMultipleCategories is true. Its default value is empty.

Type:
string readonly
Implemented in:
QuestionToolbox
See also:
allowExpandMultipleCategories * , expandCategory * , collapseCategory
addCopiedItem method

Add a copied Question into Toolbox

Type:
(question: Question, options?: any) => void
Parameters:
question, type: Question ,

a copied Survey.Question

options, type: any ,

a json object that allows you to override question properties. Attributes are: name, title, tooltip, isCopied, iconName, json and category.

Implemented in:
QuestionToolbox
addItems method

Add toolbox items into the Toolbox

Type:
(items: any, clearAll?: boolean) => void
Parameters:
items, type: any ,

the list of new items

clearAll, type: boolean ,

set it to true to clear all previous items.

Implemented in:
QuestionToolbox

Set it to true, to allow end-user to expand more than one category. There will no active category in this case

Type:
boolean writable
Implemented in:
QuestionToolbox
See also:
activeCategory
categories property

Contains toolbox categories and allows you to modify them.

View Demo

Type:
any readonly
Implemented in:
QuestionToolbox

Change categories for several toolbox items.

Type:
(changedItems: any) => void
Parameters:
changedItems, type: any ,

the array of objects {name: "your toolbox item name", category: "new category name"}

Implemented in:
QuestionToolbox

Change the category of the toolbox item

Type:
(name: string, category: string) => void
Parameters:
name, type: string ,

the toolbox item name

category, type: string ,

new category name

Implemented in:
QuestionToolbox

Remove all copied toolbox items.

Type:
() => void
Implemented in:
QuestionToolbox
clearItems method

Remove all toolbox items.

Type:
() => void
Implemented in:
QuestionToolbox

Collapse all categories. If allowExpandMultipleCategories is false (default value) this function does nothing

Type:
() => void
Implemented in:
QuestionToolbox
See also:
allowExpandMultipleCategories

Collapse a category by its name. If allowExpandMultipleCategories is false (default value) this function does nothing

Type:
(categoryName: string) => void
Parameters:
categoryName, type: string ,

the category name

Implemented in:
QuestionToolbox
See also:
allowExpandMultipleCategories

The maximum number of copied toolbox items. If an user adding copiedItemMaxCount + 1 item, the first added item will be removed.

Type:
number readonly
Implemented in:
QuestionToolbox
copiedItems property

The Array of copied Toolbox items

Type:
any readonly
Implemented in:
QuestionToolbox
copiedJsonText property

The Array of copied Toolbox items as Text JSON.

Type:
string writable
Implemented in:
QuestionToolbox

Adds default items to the Toolbox. If the Toolbox contains any items before you call this method, they will be removed.

Type:
(supportedQuestions: any, useDefaultCategories: boolean) => void
Parameters:
supportedQuestions, type: any ,

Specifies which question and panel types to include in the Toolbox.

useDefaultCategories, type: boolean ,

Pass true if you want to create default categories.

Implemented in:
QuestionToolbox

Defines toolbox categories from scratch.

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.

The following code defines two toolbox categories: Dropdowns and Text Input. Items that do not fall into either category are collected in Misc. The "comment" item has a custom display title.

creator.toolbox.defineCategories([{
  category: "Dropdowns",
  items: [
    "dropdown",
    "tagbox"
  ]
}, {
  category: "Text Input",
  items: [
    "text",
    // Override the display title
    { name: "comment", title: "Multi-Line Input" }
  ]
}], true);

View Demo

Type:
(categories: any, displayMisc?: boolean) => void
Parameters:
categories, type: any ,

An array of new categories.

displayMisc, type: boolean ,

Pass true if you want to collect unlisted toolbox items in the Misc category. Default value: false.

Implemented in:
QuestionToolbox

Expand all categories. If allowExpandMultipleCategories is false (default value) this function does nothing

Type:
() => void
Implemented in:
QuestionToolbox
See also:
allowExpandMultipleCategories

Expand a category by its name. If allowExpandMultipleCategories is false (default value), all other categories become collapsed

Type:
(categoryName: string) => void
Parameters:
categoryName, type: string ,

the category name

Implemented in:
QuestionToolbox
See also:
allowExpandMultipleCategories * , collapseCategory
forceCompact property

Specifies whether the toolbox should be in compact or full mode. Accepts the following values:

  • true - Toolbox is always in compact mode.
  • false - Toolbox is always in full mode.
  • undefined - Toolbox switches between the full and compact modes automatically based on available width.
Type:
boolean readonly
Implemented in:
QuestionToolbox
See also:
isCompact

Add a toolbox item

Type:
(item: IQuestionToolboxItem) => QuestionToolboxItem
Parameters:
item, type: IQuestionToolboxItem ,

the toolbox item description

Implemented in:
QuestionToolbox
See also:
IQuestionToolboxItem
getItemByName method

Returns toolbox item by its name. Returns null if there is no toolbox item with this name

Type:
(name: string) => IQuestionToolboxItem
Parameters:
name, type: string
Implemented in:
QuestionToolbox
isCompact property

Indicates whether the toolbox is currently in compact mode.

Type:
boolean readonly
Implemented in:
QuestionToolbox
See also:
forceCompact
items property

The Array of Toolbox items.

Type:
any readonly
Implemented in:
QuestionToolbox
jsonText property

The Array of Toolbox items as Text JSON.

Type:
string writable
Implemented in:
QuestionToolbox

Set it to true to expand all categories and hide expand/collapse category buttons

Type:
boolean writable
Implemented in:
QuestionToolbox
orderedQuestions property

Modify this array to change the toolbox items order.

Type:
{} writable
Implemented in:
QuestionToolbox

Removes categories from the Toolbox.

Type:
() => void
Implemented in:
QuestionToolbox
removeItem method

Remove a toolbox item by its name

Type:
(name: string) => boolean
Parameters:
name, type: string ,

toolbox item name

Implemented in:
QuestionToolbox
See also:
IQuestionToolboxItem
replaceItem method

Add a new toolbox item, add delete the old item with the same name

Type:
(item: IQuestionToolboxItem) => boolean
Parameters:
item, type: IQuestionToolboxItem ,

the toolbox item description

Implemented in:
QuestionToolbox
See also:
IQuestionToolboxItem

Specifies whether to display category titles in the Toolbox.

If you disable this property, the Toolbox hides the titles but continues to display horizontal lines that divide categories. To remove these lines as well, call the removeCategories() method.

Type:
boolean writable
Implemented in:
QuestionToolbox
See also:
removeCategories

Copyright © 2024 Devsoft Baltic OÜ. All rights reserved.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.