Note that there are some explanatory texts on larger screens.

plurals
  1. POjsTree with Json-Data, don't get metadata
    text
    copied!<p>i read many suggestions concerning jsTree/Json/metadat, but I don't found a working solution. I want to get the metadata (e.g. id) if a node is clicked. </p> <p>1st my Json Data:</p> <pre><code>[ { "data":{ "title":"TEST", "icon":"/i/small_folder.gif", "attr":{ "id":"1000000000000000021" }, "metadata":{ "id":"1000000000000000021" } } } ] </code></pre> <p>2nd JS function which create the tree and should get the clicked id(ajax call and some oracle apex stuff)</p> <pre><code>function populateTree(pRegionId) { console.log('---Js Tree---'); $.ajax({ type : 'POST', async : true, url : 'wwv_flow.show', data : { "p_request" : 'APPLICATION_PROCESS=GET_TREE', "p_flow_id" : $v('pFlowId'), // app id "p_flow_step_id" : $v('pFlowStepId'), // page id "p_instance" : $v('pInstance'), // session id }, ggg : pRegionId, success : function (data) { console.log(data); var jsonobj = JSON.parse(data); apex.jQuery("#" + this.ggg).jstree({ "themes" : { "theme" : "default", "dots" : false, "icons" : true }, "json_data" : { "data" : [jsonobj] }, "plugins" : ["themes","json_data", "ui"] //}).bind("select_node.jstree", function (e, data) { alert(data.rslt.obj.data("jstree").id); }); }).bind("select_node.jstree", function (e, data) { console.log(data); }); } }); } </code></pre> <p>3rd the object where the id should be (firebug domview):</p> <pre><code> args [a#1000000000000000301.jstree-clicked #, true, Object { originalEvent=Event click, type= "click", timeStamp=30977664, mehr...}] inst Object { data={...}, get_settings=function(), _get_settings=function(), mehr...} rlbk false rslt Object { obj={...}, e={...}} e Object { originalEvent=Event click, type="click", timeStamp=30977664, mehr...} obj jQuery(li.jstree-closed) </code></pre> <p>as you can see there is no id. So I guess something with the metadata part is messy but i cannt figure out where the mistake is.</p> <p>Thanks in advance Mario</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload