Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Loading the content of folder in a Tree

    Hi,

    I've a tree that loads on demand its data. When a user selects one folder, it can open a window and operate with it. This window needs to know the folder's children.

    If you invoke a Tree.openFolder() it's asynchronous, so in code like this:

    tree.openFolder()
    window.show()

    You will end up with the window being show before the tree folder is loaded.

    On the other hand, if you add a:

    tree.addDataChangedHandler()

    to get notified when the data changes, it's not a clean way to do this.

    Anyway, opening the folder is a side effect: before showing the window the only thing I need to do is to load the folder children in the model, not to open that folder.

    Do you know any clean solution for this?

    Thanks in advance,
    Juan

    #2
    Listening for DataChanged is the right approach. We'll consider adding a callback param to openFolder as a convenience to avoid a one-time registration for dataChanged().

    Comment


      #3
      Thank you.

      Do you know if is there a way to load the children without visually showing them ?

      Comment

      Working...
      X