[Dojo-interest] (Order of) callbacks on changes to a tree model

Wolfgang Pausch wolfgang.pausch at iteg.at
Thu Jan 9 13:23:30 EST 2014

starting with a dijit/Tree that contains the following path:


I want to rearrange it to have the structure


i.e. move D to a sibling E of C, which is created in that moment and added to B.

I have now spent several hours on trying to use onChildrenChange and onDelete in a correct manner, but somehow, I am failing.  Either I get errors of 
the kind addChild | removeChild not defined, or some portions of the tree are not showing up afterwards.  Both for onChildrenChange and onDelete, I 
tried code that calls the methods from top to bottom, and several other orders etc. as well.

So question: Can someone give me a hint what would be the correct order of calling callbacks when doing changes are described above?  Is there any 
further well-known mistake I might do?

Is there any more elegant way to update a tree on major changes to its model, e.g. (re)moving or adding several paths inside it in one action 
initiated by the user?

Thanks in advance,


More information about the Dojo-interest mailing list