No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [Solved] [V1] QTree does not expand all by property default-expand-all

    Framework
    3
    5
    909
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Stanley last edited by Stanley

      Dear Quasar team,

      I reproduced the issue with below link.
      https://codepen.io/Stanley-549393092/pen/RwbrVNr
      Normally, when set nodes with fixed value, it will expand all the node because I set the property default-expand-all.
      But if the value of nodes is dynamic, it does not work. I also tried using “this.$refs.tree.expandAll()”, it is still not working.
      Could you please check it?

      1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman last edited by

        @Stanley try this https://codepen.io/metalsadman/pen/rNBxwgy

        S 1 Reply Last reply Reply Quote 0
        • S
          Stanley @metalsadman last edited by

          @metalsadman Wow, it’s amazing. Thanks!

          1 Reply Last reply Reply Quote 0
          • M
            Mickey58 last edited by

            I’m using the same code that uses the expandAll() API to expand all nodes of my q-tree. It works well.

            @metalsadman - can you explain why

            this.$nextTick(()=>{this.$refs.tree.expandAll()})
            

            is needed in this case?

            I first tried, like @Stanley, a simple

            $refs.tree.expandAll()
            

            and that does not expand the q-tree.

            metalsadman 1 Reply Last reply Reply Quote 0
            • metalsadman
              metalsadman @Mickey58 last edited by

              @Mickey58 best explained from vue doc’s api https://vuejs.org/v2/api/#Vue-nextTick.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post