1

I using the fancytree plugin.

sometimes i get empty data from the server(because this the result of the user input). but i want to know that ther is no data.

what is the event when there is no data?

enter image description here

eyalb
  • 2,994
  • 9
  • 43
  • 64

1 Answers1

1

You can use the loadChildren event which fires when the initial nodes are loaded (and after lazy nodes are expanded and loaded). data.node.children contains the result then. loadError is another event you may want to know of:

$("#tree").fancytree({
  loadChildren: function(event, data) {
    console.log(event.type, data.node.children.length);
  },
  loadError: function(event, data) {
    console.log(event.type, data);
  },
mar10
  • 14,320
  • 5
  • 39
  • 64