Autor | Zpráva | ||
---|---|---|---|
Jack06 Profil |
#1 · Zasláno: 22. 6. 2010, 21:47:53
Zdravíčko, mám následující js kód pro jsTree:
$(function() { $('#menuEdit').jstree({ plugins : [ "themes", "json_data", "ui", "crrm", "cookies", "dnd", "search", "types", "contextmenu" ], json_data : { ajax : { url : {$baseUri} + 'administrace/catalog/json/', data : function (n) { return { id : n.attr ? n.attr("id").replace("node_","") : 0}; } } }, themes : { url : {$baseUri} + 'css/jsTree/themes/', dots : true, icons : false }, dnd : { drop_finish : function () { alert("DROP"); }, drag_check : function (data) { if(data.r.attr("id") == "phtml_1") { return false; } return { after : false, before : false, inside : true }; }, drag_finish : function () { alert("DRAG OK"); } }, }); }); ajax mi vyvolá get a ten mi vrátí výpis takovýto: {"data":[{"attributes":{"id":2},"state":"leaf","data":"Blaaaaa","children":[]},{"attributes":{"id":6},"state":"open","data":"Test 6","children":[{"attributes":{"id":7},"state":"leaf","data":"fdsf","children":[]},{"attributes":{"id":5},"state":"open","data":"Test 5","children":[{"attributes":{"id":4},"state":"open","data":"Test 4","children":[{"attributes":{"id":3},"state":"leaf","data":"Test 3","children":[]}]}]},{"attributes":{"id":1},"state":"leaf","data":"Test 1","children":[]}]},{"attributes":{"id":8},"state":"leaf","data":"Test","children":[]}]} problém je v tom, že se mi to ale nedaří vypsat na stránku, nevidím nic.. jen prázdná pole.. s novou dokumentací si nemohu poradit není tam vůbec jak na to... html vypadá takto po vygenerovaní tím jstree, ale obsah se do něj nevloží..: <div id="menuEdit" class="jstree jstree-0 jstree-focused jstree-default"> <ul class="jstree-no-icons"> <li class="jstree-last jstree-leaf"> <ins class="jstree-icon"> </ins> <a href="#" class=""><ins class="jstree-icon"> </ins></a> <a href="#" class=""><ins class="jstree-icon"> </ins></a> <a href="#" class=""><ins class="jstree-icon"> </ins></a> </li> </ul> </div> Prostě si nevím rady co s tím.. asi to bude nějaká hovadina, ale tak pokud někdo ví, tak ěm nakopněte díky. |
||
Časová prodleva: 14 let
|
0