AdminLTE icon indicating copy to clipboard operation
AdminLTE copied to clipboard

how to render a tree in AdminLTE

Open weituotian opened this issue 9 years ago • 7 comments

For some reason,i need to render a tree to show the data. now i had a problem that what should i did in AdminLTE. 1444617407382356

weituotian avatar Jan 09 '17 14:01 weituotian

Please provide code for example.

REJack avatar Jan 09 '17 14:01 REJack

[{ "text": "Same but with checkboxes", "children": [{ "text": "initially selected", "state": { "selected": true } }, { "text": "custom icon", "icon": "fa fa-warning icon-state-danger" }, { "text": "initially open", "icon": "fa fa-folder icon-state-default", "state": { "opened": true }, "children": ["Another node"] }, { "text": "custom icon", "icon": "fa fa-warning icon-state-warning" }, { "text": "disabled node", "icon": "fa fa-check icon-state-success", "state": { "disabled": true } }] }, "And wholerow selection" ]

i want to tranlaste the json data for view just like this: q -20170109223910

superUI does this for us! http://www.supermgr.cn/components/ui_tree.html

but i want the best way to do this in AdminLTE! Could this job be accepted?

u 1615939549 2060279394 fm 116 gp 0

weituotian avatar Jan 09 '17 14:01 weituotian

AdminLTE has no Tree View UI like SuperUI, but they use a free script for this named jsTree you can add this by hand to AdminLTE if you want it.

regards REJack

REJack avatar Jan 09 '17 14:01 REJack

thanks! But does jsTree ' css compatible with AdminLTE style? 0066d6a4jw1fbkhymspksj30c80c8aa4

weituotian avatar Jan 10 '17 13:01 weituotian

Puhh i dont know, you need to test it, but you can copy the style from superUI 😄

REJack avatar Jan 10 '17 13:01 REJack

Basically AdminLTE runs on CI, so Js based on CI will run in AdminLTE (logically speaking LOL) You may try this tutorial @weituotian http://webeasystep.com/blog/view_article/Build_dynamic_tree_nodes_with_jstree_and_codeigniter or this one http://phpflow.com/php/dynamic-tree-with-jstree-php-and-mysql/

and customize the style as you like

eruvierda avatar Jan 11 '17 13:01 eruvierda

Although AdminLTE provides a treeview for its sidebar, the custom plugin is not generic enough to create a tree menu like the one you requested. However, as everyone here mentioned, you could easily use other implementations like the one used in SuperUI.

Hopefully in v3, the script we wrote can be very customizable and be used in more ways than the sidebar.

Thanks!

almasaeed2010 avatar Jan 11 '17 14:01 almasaeed2010