mayank091193/quasar-draggable-tree

sync changes with datasource

Opened this issue · 4 comments

currently this code:

updateItem(itemValue) {
                const index = this.localValue.findIndex(v => v[this.rowKey] === itemValue[this.rowKey]);
                this.$set(this.localValue, index, itemValue);
                this.$emit("input", this.localValue);
            }

emits the whole tree struct from this.localValue. It would be helpful to also emit only changes after dropping the node. This event should have source node, target node, source position, target position etc.
With such event it would be possible to efficently synchronize state in big (1000+ nodes) trees.

I was also searching for the normal drag/moved event...

My goal was to create some minimal CRUD showcase (btw: that should be the example):

  • add node
  • edit node
  • delete node
  • sync changes and group/node moves with backend

Thank you for writing. I will work on it as soon as I get time.

I do not understand how to use events

Is this project still alive? Because if so, they should prioritize this issue, since this component is not very useful if we cannot update the backend.