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
    1. Home
    2. user123
    U
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 2
    • Best 0
    • Groups 0

    user123

    @user123

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    user123 Follow

    Latest posts made by user123

    • How can I get current node and pass it as request parameter to display it child nodes using Quasar Tree lazy loading?

      I am using Quasar Tree lazy loading to display the data like shown in image

      scn.png

      onclick of first node I am displaying child nodes from a local JSON file, now when i click on respective child node I want to display it sub childs from another JSON file by passing its parent node id.
      Here is my code

      <template>
        <q-page class="flex fixed-left">
          <q-tree
            :nodes="treeArr"
            node-key="id"
            label-key="content"
            ref="tree"
            no-connectors
            :selected.sync="selected"
            text-color="blue"
          >
          </q-tree>
         
      
        </q-page>
      </template>
      <style >
      </style>
      <script>
      
      
      
      import someJson from "./static/somejson.json";
      import datasetsJson from "./static/datasetsjson.json";
      
      
      export default {
        name: "HelloWorld",
        data() {
          return {
            tree: [],
            selected: "",
            selectedObject: null,
            json: someJson,
            djson: datasetsJson,
            newObj: [],
            treeArr: [
              {
                content: "Resources",
                children: [],
              },
            ],
          };
        },
        computed: {},
        methods: {},
          
        created() {
          this.tree = this.get_leaves()
          console.log("json", someJson);
      
         Object.keys(this.json.body.projects.projects).forEach((j) => {
      
           
       var child = { id: j, content: this.json.body.projects.projects[j].friendlyName, children: [] };
       this.treeArr[0].children.push(child);
      console.log("test", this.json.body.projects.projects[j]);
      console.log("childs", child);
      })
      
          
        },
      };
      </script>
      

      Can any one please tell me how can I get current node and pass it as request parameter to display its respective child nodes.

      posted in Framework
      U
      user123