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

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -