- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.JavaScript pack. It includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are more details and live demo for anyone interested.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Pages: 1 2  Send Topic Print  
change color link and property
Read 1916 times

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
change color link and property
Oct 15th, 2018 at 12:36pm
 
hello,
I'm using ASP webforms and mindfusion.
how can I write two text in the same link ?
how can I change the link color using a color palette?
how can I remove link arrows and use a single line?
as present in the attachment
thanks
 
 

Sans_titre3.png (3 KB | 80 )
Sans_titre3.png
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1865
Gender: male
tech.support


   
     
 
Re: change color link and property
Reply #1 - Oct 15th, 2018 at 5:22pm
 
Hi,

Quote:
how can I write two text in the same link ?


Call the link's AddLabel method (or addLabel in JS code).

Quote:
how can I change the link color using a color palette?


Set link's Pen property (setPen / setStroke in JS).

Quote:
how can I remove link arrows and use a single line?


Set link's HeadShape property to Arrowheads.None / null.

Regards,
Slavcho
Mindfusion
 
 
 
IP Logged    
 
     

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: change color link and property
Reply #2 - Nov 6th, 2018 at 9:42pm
 
Hello,
I want when I click on the link in the top part a text box opens and even in the bottom part of the link
so two text box in the link.
Thanks
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1865
Gender: male
tech.support


   
     
 
Re: change color link and property
Reply #3 - Nov 7th, 2018 at 12:09pm
 
You could call link.addLabel from linkClicked handler and then LinkLabel.setLinkLengthPosition(...) to move the label towards the start or end of the link.

Regards,
Slavcho
 
 
 
IP Logged    
 
     

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: change color link and property
Reply #4 - Nov 9th, 2018 at 4:12pm
 

thank you for your help. Smiley
but when I define two labels I initialize side javascript code and when I click to change. the original text remains below the new text.
so there is a problem of modification textarea zone size.
Undecided

Code :
  function onLinkCreated(sender, args) {
        var link = args.getLink();
        link.setHeadShape("");
        link.setBaseShape("");
        link.addLabel("T1").setLinkLengthPosition(0.1);
        link.addLabel("T1").setLinkLengthPosition(0.9);

      
    }
 
 

pTwolabel.png (9 KB | 82 )
pTwolabel.png
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1865
Gender: male
tech.support


   
     
 
Re: change color link and property
Reply #5 - Nov 12th, 2018 at 7:38am
 
Hi,

Maybe there's duplicated T1 label overlapping the edited one? How many elements can you see in link.labels array, e.g. from a breakpoint in linkClicked handler?

Regards,
Slavcho
 
 
 
IP Logged    
 
     

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: change color link and property
Reply #6 - Nov 13th, 2018 at 10:58am
 
Hello   
*the same problem at the label editing level the text box is very small, also if I delete the label it becomes inaccessible.
*the link changes behavior after save
how do I keep their behavior even after saving
attached pice present

1 before saving
2 after saved
I want always presented as 1
I use mindfusion ASP webforms
Thanks for your help
 
 

aftersave.png (13 KB | 88 )
aftersave.png
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1865
Gender: male
tech.support


   
     
 
Re: change color link and property
Reply #7 - Nov 13th, 2018 at 1:24pm
 
Hi,

1. Handle the enterInplaceEditMode event to get a reference to the area element used as editor (args.control) and apply some minimum width / height to it.

2. What methods are you using to save and load?

Regards,
Slavcho
 
 
 
IP Logged    
 
     

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: change color link and property
Reply #8 - Nov 13th, 2018 at 3:56pm
 
thank you for your reply.
I used the following two methods:

protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(tbFileName.Text))
        {
            string localDir = MapPath(@"Files\");
            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
            canvasView.SaveToXml((localDir + tbFileName.Text);
        }
    }

protected void btnLoad_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(listFileNames.SelectedValue))
        {
            string localDir = MapPath(@"Files\");
            canvasView.Diagram.LoadFromXml(localDir + listFileNames.SelectedValue,true);
        }
    }
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1865
Gender: male
tech.support


   
     
 
Re: change color link and property
Reply #9 - Nov 13th, 2018 at 4:55pm
 
Could you attach XML file for the above example?
 
 
 
IP Logged    
 
     

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: change color link and property
Reply #10 - Nov 14th, 2018 at 7:23am
 
Hi,
When I click on the button save the diagram gets refreshed and becomes like the picture 2 presented above.
Method Save :
protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(tbFileName.Text))
        {
            string localDir = MapPath(@"Files\");      
            canvasView.SaveToXml(localDir + tbFileName.Text);
        }
    }
Method Load:
protected void btnLoad_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(listFileNames.SelectedValue))
        {
            string localDir = MapPath(@"Files\");
            canvasView.Diagram.LoadFromXml(localDir + listFileNames.SelectedValue,true);
        }
    }

attached XML file
 
 

testXml.rar (3 KB | 51 )
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1865
Gender: male
tech.support


   
     
 
Re: change color link and property
Reply #11 - Nov 14th, 2018 at 12:21pm
 
Hi,

It loaded as a straight line in my test. Check if you aren't calling link.route() or diagram.routeAllLinks() methods in some event handlers?

Regards,
Slavcho
 
 
 
IP Logged    
 
     

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: change color link and property
Reply #12 - Nov 14th, 2018 at 4:30pm
 
Thank you for your quick reply. Cheesy
now the save and loading is working properly.
so I changed the style of the text box
Just the problem of editing the label link.
if I delete the label I can not insert it anymore and change position.
I presented my problem in the video.
 
 

 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1865
Gender: male
tech.support


   
     
 
Re: change color link and property
Reply #13 - Nov 14th, 2018 at 7:18pm
 
Right, the label isn't actually deleted but becomes hard to hit when its text is empty, and then the diagram starts editing the link.text property instead of a LinkLabel. You could extend the hit-testing method along these lines to always return one of the labels depending on distance from end points -

Code:
DiagramLink.prototype.getObjectToEdit = function (point, element)
{
	if (element && (mflayer.isInstanceOfType(mdiag.LinkLabel, element)))
		return element;

	var label = this.labelFromPoint(point);
	if (label != null)
		return label;

	// above is the standard hit-testing code;
	// revise this depending on number of labels:
	if (point.distance(this.getStartPoint()) < 20)
		return this.labels[0];
	if (point.distance(this.getEndPoint()) < 20)
		return this.labels[2];

	return this.labels[1];

	//return this;
}; 



Regards,
Slavcho
 
 
 
IP Logged    
 
     

08804139   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: change color link and property
Reply #14 - Dec 21st, 2018 at 10:11pm
 
Hello
can you give me more idea and clarify the previous point.
and how I can direct the text of the link on the left as indicated by the attachment.
thank you.
 
 

test_002.png (13 KB | 75 )
test_002.png
 
IP Logged    
 
     
Pages: 1 2  Send Topic Print