I use tree.Panel and TreeStore component. I use JSON file to store my datas but i would like know, how to upgrade my data with a TreeStore ?!
I explain my problem : I have 2 components on my page :
Tree.Panel who display data with TreeStore and Panel to editing data, because i don't find how to editing tree directly ?!
I want to use a Submit button to update data on my tree but i don't understand how to do this?!
If its possible ?!
I don't understand how i can add new node , upgrade node and delete node ?!
Or there exist maybe TreeEditor component ?!
Thanks a lot to helps :)
I think we are yet to see a TreeEditor component. But there are ways to manipulate your existing tree. You should be able to add, update, remove tree nodes using the methods of NodeInterface.
You have methods like:
etc...
Here is a sample code how you can append a new node to your tree:
var node = myTreeStore.getRootNode();
node.appendChild({
text: 'A New node'
});
Similarly you can make use of other methods to manipulate the tree. To insert node into specific location, you will have to use the insertChild
. For this method, you will have to specify the location as well.
In short, the access point of editing your tree is your TreeStore's getRootNode()
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With