var tree = mini.get("leftTree");
//树的点击事件
function onNodeSelect(e) {
var node = e.node;
var isLeaf = e.isLeaf;
if (isLeaf) {
showTab(node);
}
}
//标签页
function showTab(node) {
var tabs = mini.get("mainframe");
var id = "tab$" + node.id;
var tab = tabs.getTab(id);
if (!tab) {
tab = {};
tab._nodeid = node.id;
tab.name = id;
tab.title = node.text;
tab.showCloseButton = true;
tab.url = node.id + ".jsp";
tabs.addTab(tab);
}
tabs.activeTab(tab);
}
//关闭标签
function removeTab() {
var tab = mini.get("mainframe");
tab.removeAll(tab);
}
function onClick(e) {
var text = this.getText();
alert(text);
}
function onTabsActiveChanged(e) {
var tabs = e.sender;
var tab = tabs.getActiveTab();
if (tab && tab._nodeid) {
var node = tree.getNode(tab._nodeid);
if (node && !tree.isSelectedNode(node)) {
tree.selectNode(node);
}
}
}