2014-04-07 22 views
1

是標題說明了一切..添加鏈接的Jquery EasyUI樹(使用JSON數據)

如何添加一個鏈接到該基於的jQuery EasyUI產生JSON數據樹?

我一直在尋找任何東西,但沒有得到。已經嘗試添加

"attributes":{ 
    "url":"http://google.com" 
} 

和仍然沒有工作..

可以肯定的...

HTML

<ul class="easyui-tree" data-options="url:'<?php echo Router::url('/files/admin_menu.json'); ?>',method:'get',animate:true,dnd:true,lines:true"></ul> 

的JSON填充樹(我想鏈接的儀表盤菜單以google.com *爲例,但如何?)

[{ 
    "id":1, 
    "text":"BAMS", 
    "children":[{ 
     "id":13, 
     "text":"Dashboard", 
     "iconCls":"icon-home" 

    },{ 
     "id":11, 
     "text":"Master", 
     "state":"open", 
     "children":[{ 
      "id":111, 
      "text":"Brand", 
      "iconCls":"icon-brand" 
     },{ 
      "id":112, 
      "text":"Vendor", 
      "iconCls":"icon-vendor" 
     },{ 
      "id":113, 
      "text":"Crew Function Type", 
      "iconCls":"icon-user" 
     },{ 
      "id":114, 
      "text":"Crew Function", 
      "iconCls":"icon-user" 
     },{ 
      "id":115, 
      "text":"Crew Position", 
      "iconCls":"icon-user" 
     },{ 
      "id":116, 
      "text":"Program Type", 
      "iconCls":"icon-program" 
     }] 
    } 
}] 

在此先感謝

+0

人幫助:( – aswzen

+2

解決了添加URL鏈接的JSON數據.. 「文」: 「Whyitssodifficult」, – aswzen

回答

1

不錯的一個。

在我的情況下,一個hraf =需要單引號:

"text":"<a href='Ohmygod'>Whyitssodifficult</a>" 
+0

我的猜測是aswzen使用瞭如下的反斜槓:'\「Ohmygod \」'以逃避引號。不幸的是,他忘了正確地用反引號格式化他的評論,於是他的反斜槓消失了。他想要的解決方案很可能是「text」:「Whyitssodifficult 「'。 – Xufox