Page Index Toggle Pages: 1 2 [3]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Can we add inside container node another container node on click of expand collapse button (Read 9807 times)
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: Can we add inside container node another container node on click of expand collapse button
Reply #30 - Feb 11th, 2021 at 1:17pm
Print Post  
actually i do not know why but i used 3.5.2 version in package.json and do npm install whatever js added in node module for mindfusion mindfusion.common and mindfusion.diagramming added that set but not working with that dll.

Now i added your js file mindfusion.common and mindfusion.diagramming.js it works for me working.

Thank You Smiley

But one thing i do not understand i have used same version i.e 3.5.2 version file my file after npm install not working but your's file working which version of your files that you send me in zip example of sample javascript demo.
Please let me know
« Last Edit: Feb 12th, 2021 at 9:54am by reshma »  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: Can we add inside container node another container node on click of expand collapse button
Reply #31 - Feb 17th, 2021 at 9:11am
Print Post  
one more issue i am facing  the image icon adding on childern :adding image icon in node with function getGraphicsContent on updatevisuals but for 300 reocords not showing icon (mostly for child inside chils)immedietly.Please let me know is any other way to add image.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Can we add inside container node another container node on click of expand collapse button
Reply #32 - Feb 17th, 2021 at 11:36am
Print Post  
Images in HTML / JavaScript load asynchronously, you might need to repaint the canvas from their load event handler. E.g. see https://mindfusion.eu/Forum/YaBB.pl?num=1491568907/3#3
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: Can we add inside container node another container node on click of expand collapse button
Reply #33 - Feb 17th, 2021 at 2:08pm
Print Post  
image is showing for child but not showing or taking so much time for subchild i guess on updatevisuals when this event is called it is called from parent to child always , that's why taking time for child within child for above 300 records.
Please le me know what i can do in this case,
below is my code added on updatevisuals,
this.container.onUpdateVisuals = (item: MindFusion.Diagramming.DiagramNode) => {


const image = new MindFusion.Drawing.Image(config.imageRect);
image.image.src = this.nodeAttribute.imageUrl;
image.image.addEventListener("load", function () {
image.loaded = true;
if (item.getContainer()) {
item.invalidate();
}
});
image.loaded = image.image.complete;
item.getGraphicsContent().push(image);
« Last Edit: Feb 18th, 2021 at 5:39am by reshma »  

image_icon_not_showing.png ( 27 KB | 96 Downloads )
image_icon_not_showing.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Can we add inside container node another container node on click of expand collapse button
Reply #34 - Feb 18th, 2021 at 6:48am
Print Post  
Are you loading a different image for each node? Browser itself would need a lot of time to load 300 images, and showing them in the diagram instead of directly on page won't magically load them any faster.

If it's a shared image, make sure it's loaded through same URL - browser should return cached image immediately. Even better, don't create multiple DOM Image objects with a common src, but keep it a shared reference accessible by all nodes. Note the difference between MindFusion.Drawing.Image and DOM Image, e.g. in "image.image" part of your code, first is diagram's Image component, second is DOM object.
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: Can we add inside container node another container node on click of expand collapse button
Reply #35 - Feb 18th, 2021 at 7:23am
Print Post  
yes i am loading different image for each node
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 
Send TopicPrint