Jstree容器是空的

时间:2017-09-15 13:15:31

标签: javascript jstree

我的分区

<div id="container">

Jstree配置

$('#container').jstree({
'core' : {
    'plugins': ["wholerow", "checkbox"],
  'data' : {
    "url" :apex.server.url ({p_request: "APPLICATION_PROCESS=GET_NODE_DATAA",x01: 0 || 0,x02: "LOADA" }),
      "dataType" : "json", // needed only if you do not supply JSON headers
    "dataFilter" : function (new_data) {
      return new_data ;
    }
  }
}

});

运行jstree配置和new_data输出后的服务器数据编辑

[{"data":{"title":"Form Modules(15)","attr":{"href":"#"},"icon":"form"},"attr":{"id":"1149043"},"state":"closed"},{"data":{"title":"PL/SQL Libraries(16)","attr":{"href":"#"},"icon":"pll"},"attr":{"id":"1149044"},"state":"closed"},{"data":{"title":"Menu Modules(2)","attr":{"href":"#"},"icon":"menu"},"attr":{"id":"1149045"},"state":"closed"},{"data":{"title":"Object Libraries(5)","attr":{"href":"#"},"icon":"olb"},"attr":{"id":"1149046"},"state":"closed"},{"data":{"title":"Report Modules(12)","attr":{"href":"#"},"icon":"onrptprop"},"attr":{"id":"1149047"},"state":"closed"},{"data":{"title":"APEX Applications(5)","attr":{"href":"#"},"icon":"apex"},"attr":{"id":"1149048"},"state":"closed"},{"data":{"title":"Database Objects(1701)","attr":{"href":"#"},"icon":"database"},"attr":{"id":"1149049"},"state":"closed"},{"data":{"title":"ASCII FILES(11)","attr":{"href":"#"},"icon":"ascii"},"attr":{"id":"1149061"},"state":"closed"}]

但jstree显示就像在screehot

screeshot. But it dont display Data

1 个答案:

答案 0 :(得分:0)

我知道我的答案不是使用Json的常规方法,但是如果你可以返回一个html字符串服务器端,你可以将jsTree与HTML feed方法一起使用:它适用于<ul>和{{ 1}}其中<li>是一个节点。我确定您之后需要使用ID来执行某些操作,然后尝试在HTML字符串中使用<ul> arttribute来获取它