How to get checked Items as a unordered list

Im not yet very familiar with DHTMLX-Tree, but I will use it (Pro-version) since it is just what I was looking for. My Question: <br> <br>I have a large tree with several hundreds of items. After the user has finished checking the Items he wants or needs to select I want to present the checked Items as unordered list >ul></ul>, showing the same structure of levels he checked before. I just can't find a way to do this. I guess its easy but not for me.



By the side: It’s a great tool! Thanks a lot for that.


Hello,


there is no such a built-in functionality in tree.


Tree allows to get checked items by using getAllChecked() method. Or you can iterate through all tree nodes and check they state ( getSubItems(itemId) and isItemChecked(itemId) methods).


You can use one of this approach for creating unordered list.


The full list of tree method can be found in the documentation dhtmlxTree/doc/alpha.html ( dhtmlx.com/docs/products/dhtmlxT … alpha.html )

Thanks for the answer. I solved the problem. If anybody is interested, this is my way of generating a UL-List from checked items in the tree:
You need to adjust the following:

  • path to your CSS-File in line 12
  • path to your javascript files in lines 14, 15
  • path to image in line 32
  • load the correct XML-File in line 36




   
Generate UL-List from Tree






<script  src="…/…/codebase/dhtmlxcommon.js">
    <script  src="…/…/codebase/dhtmlxtree.js">
   
   

   
   




Zeige alle markierten