目前做了一个easyui项目需要显示多级菜单,菜单配置到数据库中,因此每级菜单都需要到数据库中取,用了jQuery EasyUI方便多了。
效果体验:
下载:参考:HTML代码:1 2 3 4 5树菜单操作 - jQuery EasyUI 范例 - 何问起 6 7 8 9 10 11 12 13 14 树菜单操作
15点击下列按钮体验效果.
16 222325 26 首页27 49 5024
菜单项的json文件代码:
[{"id": 1,"text": "Tree菜单","children": [{"id": 11,"text": "Photos","state": "closed","children": [{"id": 111,"text": "何问起"},{"id": 112,"text": "EasyUI"},{"id": 113,"text": "jQuery"}]},{"id": 12,"text": "Program Files","children": [{"id": 121,"text": "HoverClock"},{"id": 122,"text": "画饼图","attributes": {"p1": "Custom Attribute1","p2": "Custom Attribute2"}},{"id": 123,"text": "批量重命名"},{"id": 124,"text": "图像转码","checked": true}]},{"id": 13,"text": "见缝插针"},{"id": 14,"text": "选择题"},{"id": 15,"text": "图标"},{"id": 16,"text": "原文"}]}]
更多特效: