setting.async.autoParam.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Array(String)</span><span class="path">setting.async.</span>autoParam</h2>
  4. <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
  5. <div class="desc">
  6. <p></p>
  7. <div class="longdesc">
  8. <p>During asynchronous loading, a request is sent to the server, which contains the identify of the parent node,
  9. so it can retrieve the children.
  10. This attribute is an array of strings, which is the identity parameter (or parameters).
  11. It applies when <span class="highlight_red">[setting.async.enable = true]</span></p>
  12. <p>Default:[ ]</p>
  13. </div>
  14. </div>
  15. <h3>Array(String) Format</h3>
  16. <div class="desc">
  17. <p>1. Put the attribute name(s) of node to the array. For example: ["id", "name"]</p>
  18. <p>2. You can rename the parameter name as sent to the server. For example: server only accepts "zId" -- ["id=zId"]</p>
  19. </div>
  20. <h3>Examples of setting</h3>
  21. <h4>1. set auto commit 'id' attribute</h4>
  22. <pre xmlns=""><code>var setting = {
  23. async: {
  24. enable: true,
  25. url: "http://host/getNode.php",
  26. autoParam: ["id"]
  27. }
  28. };
  29. If we have a parent node: {id:1, name:"test"}, When we are asynchronously loading this parent node's children, it will be submitted to the server with parameters: id=1
  30. ......</code></pre>
  31. <h4>2. set auto commit 'id' attribute, but the parameter name expected by the server is 'zId'</h4>
  32. <pre xmlns=""><code>var setting = {
  33. async: {
  34. enable: true,
  35. url: "http://host/getNode.php",
  36. autoParam: ["id=zId"]
  37. }
  38. };
  39. If we have a parent node: {id:1, name:"test"}, When we are asynchronously loading this parent node's children, it will be submitted to the server with parameters: zId=1
  40. ......</code></pre>
  41. </div>
  42. </div>