- 博客分类:
- Java Web开发
- $.parser.parse();
- $.ajax({
- url:my.bp()+'/main/menuaction!createMenu.action',
- type:'post',
- async: false,
- dataType:'json',
- success:function(data){
- $.each(data, function(i, item){
- $('#main_west_accordion').accordion('add',item);
- $('#'+item.id).html('<ul id="ctrltree'+item.id+'" style="margin-top: 5px;"></ul>');
- $('#ctrltree'+item.id).tree({
- url:my.bp()+'/main/menuaction!treeMenu.action?id='+item.id,
- });
- $('#ctrltree'+item.id).tree({
- onLoadSuccess:function(){
- $(this).tree('options').url = my.bp()+'/main/menuaction!treeMenu.action';
- },
- onClick : function(node){
- //add(tab)
- // console.info(node);
- },
- onDblClick : function(node){
- if (node.state == 'closed'){
- $(this).tree('expand', node.target);
- }else{
- $(this).tree('collapse', node.target);
- }
- }
- });
- });
- }
- });