ATK4 How to use treeview
How to use treeview e. 开发者_如何学Pythong. as sidebar?
There are no standard element. You can build your own View. Look in other projects for some implementation or use jsTree
It seems there is an add on that is exactly for what you are looking for listed on the website. At least it seems that way according to the description.
Its located under development and add-ons. I'm thinking about trying the framework myself so I have no idea if this will work for you or not.
I noted there is a file atk4/lib/TreeView.php which extends Lister
It appears to be a bit old as it has hardcoded paths to the icon images for + and - as amodules3/templates/kt2/ which in agiletoolkit 4.1.1 is /atk4/templates/shared/images but maybe you can try adding this to a page and see what it does.
From the comments at the top, looks like it needed a mysql table with a primary key called ID and another column in the same table called parent_id which would provide the values and probably in order to display text strings would probably need another column called name in the same way refModel works.
If you decide to try and get it working, maybe you can post it back to Romans to update in ATK4.1
Please check newest ATK4 addons source:
* https://github.com/atk4/atk4-addons
* * addon "hierarchy"
* * addon "tree"
精彩评论