jQuery MiniUI
标题:
郁闷的问题
[打印本页]
作者:
fuck
时间:
2012-8-17 15:25:09
标题:
郁闷的问题
我在使用Menu时,绑定temsField属性为children,就是不出子菜单,删除绑定也没一样,把数据源children属性改成别的,再绑定也没用。就显示一级菜单,不知道这问题是不是BUG
代码
<ul id="menuUi" class="mini-menubar" style="width: 100%; border: 0;" url="menu.txt" itemsField="children" textField="Name" idField="ID"></ul>
menu.txt 内容
[
{ "ID": 1, "PicFileName": "1.gif", "Name": "菜单1", "children": null },
{ "ID": 2, "PicFileName": "2.gif", "Name": "菜单2", "children": null },
{ "ID": 3, "PicFileName": "3.gif", "Name": "菜单3", "children": null },
{ "ID": 4, "PicFileName": "4.gif", "Name": "菜单4", "children": null },
{ "ID": 5, "PicFileName": "5.gif", "Name": "菜单5", "children": null },
{ "ID": 6, "PicFileName": "6.gif", "Name": "菜单6", "children": null },
{ "ID": 7, "PicFileName": "7.gif", "Name": "菜单7", "children": null },
{ "ID": 8, "PicFileName": "8.gif", "Name": "菜单8", "children": [
{ "ID":9, "PicFileName": "9.gif", "Name": "菜单9", "children": null}]
}
]
作者:
niko
时间:
2012-8-17 15:35:31
请参考示例:
http://www.miniui.com/demo/#src=menu/menu.html
html代码:
<ul id="menu1" class="mini-menubar" style="width:100%;"
url="../data/listMenu.txt" idField="id" parentField="pid">
</ul>
JSON:
[
{ id: "1", text: "文件(F)"},
'-',
{ id: "2", text: "新建", iconCls: "icon-new", pid: "1"},
{ id: "3", text: "文件", pid: "2"},
{ id: "4", text: "文件夹", pid: "2"},
{ id: "5", text: "打开", iconCls: "icon-folderopen", pid: "1"},
{ id: "6", text: "保存", pid: "1"},
{ id: "7", text: "关闭", pid: "1"},
{ id: "8", text: "编辑(E)"},
{ id: "9", text: "剪切", iconCls: "icon-cut", pid: "8"},
{ id: "10", text: "复制", pid: "8"},
{ id: "11", text: "粘贴", pid: "8"},
{ id: "12", text: "查看(V)"},
{ id: "13", text: "帮助(H)", iconCls: "icon-help"}
]
复制代码
你不需要处理children.
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2