Monday 23 November 2015

Adding data to jqxtree dynimacally on click of nodes of a tree using AJAX call

In this blog we are explaining how to adding data to jqxtree dynimacally on click of nodes of a tree using AJAX call. We have explained with complete code and steps.


 jqtree-jquery-tree-plugin


There might be a case where user wants to add data to jqxtree on click of each individual node. Below is the code which help us to achieve the above functionality where user can get data from JSON file or database on click of each individual tree node , depending whether parent have child nodes or not. Check below code.
  1. <script type="text/javascript">
  2. $(document).ready(function () {
  3. var theme = "";
  4. // Create jqxTree
  5. var tree = $('#topictree');
  6. var source = null;
  7. $.ajax({
  8. async: false,
  9. url: "topic.php",
  10. success: function (data, status, xhr) {
  11. source = jQuery.parseJSON(data);
  12. }
  13. });
  14. tree.jqxTree({ source: source, theme: theme, height: 600, width: 400 });
  15. .....
Read full blog at- Adding data to jqxtree dynimacally on click of nodes of a tree using AJAX call .

You can check more informative blogs and tutorials at android development blogs section and can also browse the android developer forum for posting and viewing latest questions on android development.

No comments:

Post a Comment