formatting.html 1011 B

1234567891011121314151617181920212223242526272829303132
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Formatting Tree Nodes - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Formatting Tree Nodes</h2>
  14. <p>This example shows how to display extra information on nodes.</p>
  15. <div style="margin:20px 0;"></div>
  16. <div class="easyui-panel" style="padding:5px">
  17. <ul class="easyui-tree" data-options="
  18. url:'tree_data1.json',
  19. method:'get',
  20. animate:true,
  21. formatter:function(node){
  22. var s = node.text;
  23. if (node.children){
  24. s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
  25. }
  26. return s;
  27. }
  28. ">
  29. </ul>
  30. </div>
  31. </body>
  32. </html>