[Solved] Revisiting hyperlink behavior in QTree
-
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? -
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> -
Looks like the solution is to add the handler in post processing, not in construction.