-
-
Notifications
You must be signed in to change notification settings - Fork 604
-
-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Events for node changed, children changed, tree changed #419
Comments
That would be a nice feature. Currently all events are at tree-level, so I could only think of s.th. like a 'modify' event, that receives additional info like node, type (create, update, delete), and maybe additional data like a dict of modified field values. Can you provide some concrete use cases for your request? |
treeChangedEvent: Use Case1: Need to swap list of data set to display in a tree table. Base on selection, the corresponding set data is loaded in the tree. A column have buttons created in run time.Number or type of buttons are based on type of nodes. After tree is loaded, I want to bind click events of the buttons. treeChanged event would come in handy. Right now, I have to using setTimer() for it to work. nodeChangedEvent: UC2: When create or update a node, nodeChangedEvent would help to bind button events, as in use case above. childChangedEvent: UC6: To show child count on a parent node |
Thanks. |
Great. I'll read about how delegation works |
+1 to this. It would be useful to capture this moment. I would find this useful since I am needing to disable a button in my document whenever there is any change to the tree (in this case I am generating a spreadsheet from the created tree and want to prevent the user from exporting a tree before saving it to database) |
Due to low priority and current lack of resources, this issue was tentatively put aside. |
As a first step we could implement a
Since some operations (order, load) do not have one single meaningful context node, the event is fired for the parent nodes. Fancytree could trigger this on
Also a method
|
I'm trying to upgrade to version 2.21.0 from 2.15.0 and am having issues with the removal of removeNode:
I can no longer access any data of the removed nodes since the childNode is always null when removed. It looks like the removeNode was more of a "beforeRemoveNode" and the modifyChild is triggered when the node is removed. Is there are way around this (aside from manually bookkeeping all the children on the parent). Thanks |
I haven't tested, but looking at the code I would think that deleting a single node should pass the |
Ah that makes sense. Should have looked closer - my bad! |
No problem :) The reasoning was, that removing a nested branch might cause hundredths or thousands of single node removal events, wich would be a performance concern, especially if no one is listening. If there is an important use case that I am missing, let me know. Maybe this could be solved in another way. |
@pmeijer you can see delete with children @mar10 , i dont know if this usage is wrong (For treeChangedEvent )
|
Not sure if this the right channel to request features, but I think three events are missing:
when a node is changed
when children for a node is changed
when any tree node changed
Thanks for the awesome utility.
The text was updated successfully, but these errors were encountered: