Ztree tree menu interaction tab effect method

1, add custom attributes Page

2, for the ztree each tree node, add a click event

// The page is loaded after the page is loaded (function () {// 1. Perform the Ztree tree menu settings, open the simple JSON data support VAR setting = {data: {SimpleData: {Enable: True // Open the simple JSON data format support}}}, callback: {onclick: function (event, treeid, treenode, clickflag) {var content = '
' + ' ' // The tree menu without setting the Page property does not open the tab if (Treenode.page! = "") {// If the tab is already open, choose if ($ ($ ("# myTabs") . Tabs ('exissrs', treenode.name) {// Select tab $ ("# myTabs"). Tabs ('select', Treenode.name);} else {// If not open, add tab $ ("#mytabs"). Tabs ('add', {title: Treenode.Name, CoNtent: content, closable: true};}}}}}; // 2. Provide Ztree tree menu data var znodes = [{ID: 1, PID: 0, Name: "Parent Node"}} {ID : 2, PID: 0, Name: "Parent Node 2"}, {ID: 11, PID: 1, Name: "Child Node"}, {ID: 12, PID: 1, Name: "Child Node 2" }, {ID: 13, PID: 2, Name: "csdn blog", Page: "http://blog.csdn.net/a772304419"}, {ID: 14, PID: 2, Name: "Bo Garden" "http://www.cnblogs.com/niwotaxueXiba/"}]; // 3. Generate tree menu $ .fn.ztree.init ($ ("# basemenu"), setting, znodes);}
You and I learn
Tab Panel One
Tab Panel 2
The implementation method of the above Ztree tree menu interaction tab is the total content of Xiaobian sharing to everyone. I hope to give you a reference, I hope everyone will support Tumi Cloud.
© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment