<id= "menu"></div>
HTML structure
JS structure
1<script type= "Text/javascript" >2 $.ajax ({3url:thinkphp[' MODULE ' + '/index/gettree ',4Type: ' Post ',5Successfunction(data) {6$.each (data,function(i,n) {7$ (' #menu '). Accordion (' Add '),{8 Title:n.text,9Selectedfalse,TenContent: ' <div style= ' padding:0 0 0 10px; " ><ul name= "' +n.text+ '" ></ul></div> ", One }); A }); - }, - }); the$ (' #menu '). accordion ({ -Fittrue, -Borderfalse, -OnSelect:function(title,index) { +$ ("ul[name=" "+title+" "]"). Tree ({ -Linestrue, +url:thinkphp[' MODULE ' + '/index/gettree/name/' +encodeURI (title), A }); at Console.info (title) - }, - }); -</script>
I never found a problem, I don't know what the problem is, I hope the experts help solve it.
Easyui accordion for dynamic generation, accordion onselect method of dynamic Generation tree, why the second time to choose Accordion,tree to generate