jQuery MiniUI
标题:
mini-tabs 动态添加tab及outlooktree 获取不到 outlooktree
[打印本页]
作者:
gaoyong
时间:
2015-3-15 16:25:36
标题:
mini-tabs 动态添加tab及outlooktree 获取不到 outlooktree
var list = [
{ id: "base", text: "Base" },
{ id: "ajax", text: "Ajax", pid: "base" },
{ id: "json", text: "JSON", pid: "base" },
{ id: "date", text: "Date", pid: "base" },
{ id: "control", text: "Control", pid: "base" },
{ id: "forms", text: "Forms", pid: "base" },
{ id: "button", text: "Button", pid: "forms" },
{ id: "listbox", text: "ListBox", pid: "forms" },
{ id: "checkboxlist", text: "CheckBoxList", pid: "forms" },
{ id: "lists", text: "Lists" },
{ id: "datagrid", text: "DataGrid", pid: "lists" },
{ id: "tree", text: "Tree", pid: "lists" },
{ id: "treegrid", text: "TreeGrid ", pid: "lists" }
];
var item = json;
var tab = { title: item.OrgValue };
tab =
tabs
1.addTab(tab);
var el =
tabs
1.getTabBodyEl(tab);
el.innerHTML = '<div id="leftTree' + i + '" class="mini-outlooktree" ' +
'' +
' textField="name"' +
' idField="id" ' +
' parentField="pid" >' +
'</div>';
mini.parse();
var tex = mini.get("leftTree' + i + '");
tex.loadList(list ,"id", "pid");
作者:
dforce
时间:
2015-3-16 09:38:07
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="../../scripts/boot.js" type="text/javascript"></script>
</head>
<body>
<button onclick="addTab()">addTab</button>
<div id="tabs1" class="mini-tabs" style="width:400px;height:300px">
</div>
</body>
</html>
<script type="text/javascript">
var list = [
{ id: "base", text: "Base" },
{ id: "ajax", text: "Ajax", pid: "base" },
{ id: "json", text: "JSON", pid: "base" },
{ id: "date", text: "Date", pid: "base" },
{ id: "control", text: "Control", pid: "base" },
{ id: "forms", text: "Forms", pid: "base" },
{ id: "button", text: "Button", pid: "forms" },
{ id: "listbox", text: "ListBox", pid: "forms" },
{ id: "checkboxlist", text: "CheckBoxList", pid: "forms" },
{ id: "lists", text: "Lists" },
{ id: "datagrid", text: "DataGrid", pid: "lists" },
{ id: "tree", text: "Tree", pid: "lists" },
{ id: "treegrid", text: "TreeGrid ", pid: "lists" }
];
mini.parse()
function addTab() {
var tabs1 = mini.get("tabs1");
var tab = { title: "tab1" }
tabs1.addTab(tab);
tabs1.activeTab(tab);
var el = tabs1.getTabBodyEl(tab);
el.innerHTML = '<div id="leftTree1" class="mini-outlooktree" ></div>';
mini.parse();
var tree = mini.get("leftTree1")
tree.loadList(list, "id", "pid");
}
</script>
复制代码
按你的代码可以生成
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2