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

    q-tree - issues with ticked nodes

    Help
    2
    2
    285
    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
      jeffatpf last edited by

      I have a q-tree question, given this codepen:

      https://codepen.io/jeffbcole/pen/bGNXVNa?editable=true&editors=101

      I need ‘leaf’ tick strategy behavior, with the following…

      (0) When the user selects the node “0” with no other nodes selected I need the “ticked” array to contain all node id’s, including 0, 1, 2, 3. It currently only contains the id’s of the innermost children [‘1.1’, ‘1.2’, ‘2.1’, ‘2.2’, ‘3.1’, ‘3.2’]

      (1) When the user selects the node “2” (with no other nodes selected) I need the “ticked” array to contain [‘0’, ‘2’, ‘2.1’, ‘2.2’] - i.e. any node in the hierarchy above the selected node. As written the “ticked” array only contains [‘2.1’, ‘2.2’].

      (2) When the user selects the node “2.1” (with no other nodes selected) I need the “ticked” array to contain [‘0’, ‘2’, ‘2.1’] - i.e. any node in the hierarchy above the selected node. As written the “ticked” array only contains [‘2.1’].

      (3) I’d like the tree to be fully expanded with no ability to expand/collapse any node.

      I’m using q-tree in my application as a way to set hierarchal permissions.

      Any help on the above is greatly appreciated.

      Jeff.

      1 Reply Last reply Reply Quote 0
      • C
        chyde90 last edited by

        (3): Disabling expansion could be achieved with the following:

        <q-tree
           ...
           :expanded.sync="expanded"
        >
        
        computed: {
            expanded: {
                get() {
                    // return all keys
                },
                set(value) {
                    // do noting
                }
            }
        }
        

        For the other points: It sounds like you are describing the “strict” tick-strategy with the following adjustment:

        • When a node it ticked, tick all parent nodes up to the root node
          You could implement that in a watcher on the ticked property
        1 Reply Last reply Reply Quote 0
        • First post
          Last post