MDB Treeview questions


Topic: MDB Treeview questions

Tbdx23 asked 2 years ago

Hello.

I would have 4 questions.

  1. Is there any comprehensive documentation about the treeview component, eg. classes, options that are available?

  2. How can I get in my JS script the items in the tree that a user clicked on?

  3. How can I make the tree to be expanded by default (or the first level expanded, the second not)?

  4. Can I pass the tree as a JS array, or only as HTML?


Grzegorz Bujański staff commented 2 years ago

Hi.

  1. All documentation we have is available on our website.
  2. You need to add click event listeners to them.
  3. You can add the css rotate class to the fa-angle-right icon and the active class to the list that should be expanded by default.
  4. Unfortunately only as HTML

Tbdx23 answered a year ago

Thank you.

All documentation we have is available on our website.

Could I ask for a link?

You need to add click event listeners to them.

Oh, yes, I asked my question wrongly. By default only one element in the tree can be chosen. My question is, how to read, which one is it.

And additional question: in some branches I need ability to do multiple choice, and in others ability to chose just one within a single branch (with one already chosen by default). So one within a single branch, but there could be eg. 5 different branches, then in total 5 selections. How can that be done?


Grzegorz Bujański staff commented a year ago

Link to docs: https://mdbootstrap.com/plugins/jquery/treeview/

By default, multiple choice functionality is not provided. You could theoretically try to add an opened class to each item after clicking and then use this class to check if the element was "selected", but we cannot guarantee that it will work correctly.

This component has been designed for navigation on the page or elements such as dashboard, admin panel or user settings.


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No