Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible dynamic loading? #279

Open
developandbehappy opened this issue Aug 14, 2017 · 0 comments
Open

Is it possible dynamic loading? #279

developandbehappy opened this issue Aug 14, 2017 · 0 comments

Comments

@developandbehappy
Copy link

Is it possible dynamic load data and render it?
I need load data from server and render tree.
This is my solution

$scope.openTree = function (itemRefs) {
    itemRefs.open = !itemRefs.open;
    if (itemRefs.open) {
      /**
       * If the file has been opened,
       * we load data from server
       * else we close the file
       *
       */
      itemRefs.children = []; // clear children data and load it below `loadRefs`
      itemRefs.load = true;
      loadRefsItemById(itemRefs);
    }
  };

function loadRefsItemById(refsItem) {
    RefsApiService.getRefs({parentId: refsItem.id}).then(function (refRes) {
      if (refRes.hasError()) return false;
      refsItem.children = handlerDataForTheTree(refRes.getResponse(), true);
      refsItem.load = false;
    });
  }

But i need save icon of element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant