fancytree passing argument to source option -
i pass argument source ooption, "42" should passed data.php 2nd valus/key parameter.thx.
html:
<div>id="tree" datadir="42"</div> js
<script type="text/javascript"> var tree = $("#tree").fancytree("gettree"); $(function() { $("#tree").fancytree({ source: $.ajax({ url: "/data.php", data: {mode: "root", parent: tree.data.datadir}, datatype: "json" }) }); }); </script> regards
ulus
you can value using jquery. see updated code below.
html:
<div id="tree" data-dir="42"></div> js
<script type="text/javascript"> $(function() { $("#tree").fancytree({ source: $.ajax({ url: "/data.php", data: {mode: "root", parent: $("#tree").data("dir")}, datatype: "json" }) }); }); </script>
Comments
Post a Comment