Announcement

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

    How to delete all the descendants of a tree node

    Version 11.1p built 2017-12-05

    I want to delete all the sibling nodes when the remove icon for a node is clicked.
    I would appreciate if anybody helps.

    thanks,

    #2
    Title says descendants, text says siblings. Which is it?

    What specifically are you asking: how to issue "remove" dsRequests for all such nodes? Because you can do that by simply traversing the Tree data model and call DataSource.removeData() with each node's ID.

    Another, and more common alternative is to have server code that, when a folder is removed, automatically removes all descendants. This creates less client-to-server traffic.

    Comment


      #3
      Hi, Isomorphic,
      Thanks for the quick reply. I meant a descendant not a sibling sorry.
      As you suggest, I could have a server side code that removes all the descendants.
      But if there is any simpler way, I may want to use the functionality for the sake of simplicity.

      Comment


        #4
        It's up to you whether the approach described above - initiating several "remove" dsRequests from the client side - is simpler or not. We have no way of knowing how complicated this is for you on the server.

        Comment

        Working...
        X