he-tree-vue icon indicating copy to clipboard operation
he-tree-vue copied to clipboard

How can i update a specific tree node?

Open manyasone opened this issue 4 years ago • 4 comments

Hi, first of all, thanks for this nice component!

I'm wondering if I can update tree node data directly without having to reload the entire tree. For example change the title of a node in a given path, after receiving data from an http request.

Is this possible with any of the available api methods? I've been trying for a while now, but without any success.

manyasone avatar Feb 26 '21 12:02 manyasone

change node data directly

phphe avatar Feb 27 '21 09:02 phphe

Hey I have the same question, however my problem is when trying to obtain the node using getNodeByPath method, it says this method is undefined, so how exactly do I call it? I am using this.treeData.getNodeByPath(Path);

ZakTekHost avatar Feb 08 '22 11:02 ZakTekHost

Hey I have the same question, however my problem is when trying to obtain the node using getNodeByPath method, it says this method is undefined, so how exactly do I call it? I am using this.treeData.getNodeByPath(Path);

<template>
<Tree ref="tree"/>
</template>

<script>
export default {
  methods: {
    yourMethod() {
      this.$refs.tree.getNodeByPath(your path)
    }
  }
}
</script>

phphe avatar Feb 08 '22 12:02 phphe

Hey I have the same question, however my problem is when trying to obtain the node using getNodeByPath method, it says this method is undefined, so how exactly do I call it? I am using this.treeData.getNodeByPath(Path);

<template>
<Tree ref="tree"/>
</template>

<script>
export default {
  methods: {
    yourMethod() {
      this.$refs.tree.getNodeByPath(your path)
    }
  }
}
</script>

Thanks Ill Try It

ZakTekHost avatar Feb 08 '22 14:02 ZakTekHost