Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Event raised while container child added and removed (Read 948 times)
Ankur shah
Junior Member
**
Offline


I Love MindFusion!

Posts: 63
Joined: Mar 16th, 2017
Event raised while container child added and removed
Nov 26th, 2018 at 9:08am
Print Post  
I have one use case if we are having root container node and inside that we have many other container node. which can have also container node inside that.

So my question to you is

As you can see the attached pic if we are dragging node 3 in to 'Root'. Two event are fired
1. containerChildRemoved
2. containerChildAdded
I think that is correct also but when we drag node 1 inside node 2. Only one event is fired i.e. containerChildAdded. I think this is wrong as we removed the container node 1 from 'root' and added it to Node 2.
Why is this kind of behavior?

If this behavior is correct then how can i get to know it is moved inside some container which having same parent?


  

query.PNG ( 10 KB | 94 Downloads )
query.PNG
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Event raised while container child added and removed
Reply #1 - Nov 26th, 2018 at 11:06am
Print Post  
Try this to get the event raised -

Code
Select All
ContainerNode.prototype.remove = function (node, raiseEvent)
{
	var ArrayList = MindFusion.Collections.ArrayList;
	if (ArrayList.remove(this.children, node))
	{
		this.setDiagramDirty();
		delete node.container;
		//if (raiseEvent)
			this.raiseChildRemoved(node);
		if (this.parent)
			this.parent.invalidateZOrder();
	}
}; 



otherwise you might try getting old container value from containerChildAdding handler, and using it in subsequent containerChildAdded as indication of previous container.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint