Question T12417
Visible to All Users

Collapse and expand Toolboc items by categories

created 2 years ago

Hi Survey JS Team,

We are facing an issue when we try to categorize custom question types in survey creator while using angular.

I am using below properties to show the categories and make them expandable as provided in the documentation.

Code
const categories = creator.toolbox.categories; const othersIndex = categories.findIndex((category) => category.name === "Others"); const othersCategory = categories.splice(othersIndex, 1)[0]; categories.push(othersCategory); creator.toolbox.allowExpandMultipleCategories = true; creator.showSidebar = false; creator.toolbox.forceCompact = false;

I want all my custom added questions to be shown into a separate collapsible toolbox item category. Is it possible in angular?

Thanks

P.S We are in final stage of purchasing the survey js license. Soon will be purchasing the license.

Answers approved by surveyjs Support

created 2 years ago (modified 2 years ago)

Hello Aqib,
To allow users expand and collapse toolbox categories enable the creator.toolbox.showCategoryTitles option.

To add a custom question to a custom toolbox category, define the category attribute when you register a custom component. Consider this example:

JavaScript
Survey.ComponentCollection.Instance.add({ name: "country", title: "Country", category: "Custom Questions", ... } ... creator.toolbox.showCategoryTitles = true

Example.

Please let me know if you have any questions or require further assistance.

    Comments (2)

      So quick. Really Appreciate it.

        You're always welcome, Aqib.

        Please feel free to contact us if you have any questions.