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] Revisiting hyperlink behavior in QTree

    Framework
    1
    3
    516
    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.
    • J
      jackpark last edited by Shone

      Re: Q-Tree with hyperlink
      An example of a QTree handler was given: https://jsfiddle.net/s8pqkq8d/21/ and a bit more on handler was found here: https://forum.quasar-framework.org/topic/289/how-to-set-dynamic-function-to-tree-component-handler/13; a goal is to make it so that if I click on a tree node, I can push the id of that node to the router; the tree node click should behave as an href. Any further thoughts?

      1 Reply Last reply Reply Quote 0
      • J
        jackpark last edited by

        I believe that my question boils down to this, by way of explanation. I currently build the JSON tree structure from much larger nodes stored in a database. I thus construct them programatically. the linked jsfiddle suggests a structure like this: handler: (node) => this.myclick(node), but when I add something like that, runtime errors occur, the handler does not appear in node inspection, and it certainly doesn’t fire when clicked. Not sure how this will print, but the issue is something like this (wish I had a preview button to check):
        const thisNode = {}
        thisNode.label = node.label
        thisNode.img = node.img
        thisNode.handler = <this is where the problem lies>

        1 Reply Last reply Reply Quote 0
        • J
          jackpark last edited by

          Looks like the solution is to add the handler in post processing, not in construction.

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