glarsen
|
 |
« on: May 12, 2014, 06:17:37 PM » |
|
Hi. Using the Tree control and attempting to lazy load with ajax with the onBeforeExpand event.
I can see the data in Firebug in the success callback, a JSON array with node data, but nothing gets loaded to the control. New to this so I’m guessing a syntax error? Thanks for any help.
$('#security-tree').tree({ url: 'load-security-tree?n_tab_id=' + $.urlParam('n_tab_id'), onBeforeExpand: function (node) { $.ajax({ type: 'POST', url: 'load-security-node?n_tab_id=' + $.urlParam('n_tab_id') + '&sec_node_id=' + node.id, dataType: 'json', success: function (data) { //Update the tree $(this).tree('append', { parent: node.target, data: data }); }, error: function () { return false; } }); } });
Here's the data I'm trying to load:
[{"checked":false,"properties":{},"children":[]},{"id":"xZGVmYXVsdDpmOmF1dGhpZD00MjIxMTM1Mjk1","text":"Users","state":"closed","checked":false,"iconCls":"icon_namespaceFolder","properties":{"parentID":"xZGVmYXVsdA__","searchPath":"CAMID(\"default:f:authid\u003d4221135295\")","type":"namespaceFolder"},"children":[{"checked":false,"properties":{},"children":[]}]},{"id":"xZGVmYXVsdDpyOmF1dGhpZD0yMzA4NTMyNjcx","text":"Root User Class","state":"closed","checked":false,"iconCls":"icon_role","properties":{"parentID":"xZGVmYXVsdA__","searchPath":"CAMID(\"default:r:authid\u003d2308532671\")","type":"role"},"children":[{"checked":false,"properties":{},"children":[]}]}]
|