Remove link functionality

61 views
Skip to first unread message

Achyut G Patil

unread,
Sep 11, 2016, 11:24:21 AM9/11/16
to JointJS
Hi,

I have a link connected between two elements. When I hover the link, remove (X) icon is displayed.

On click of the remove icon, link is removed from the graph.

But, my requirement is to perform a customized operation before removing the link.

So, is it possible to catch remove link event on click of (X) icon.

Any help is greatly appreciated.

Regards,
Achyut

Vladimír Talaš

unread,
Oct 29, 2016, 5:06:22 PM10/29/16
to joi...@googlegroups.com
Hi, 

listen to graph.on('remove') is to late I guess... Otherwise you can create a custom action with the remove link action at the end:

    var options = {
        cellView: cellView
    };
    var halo = new joint.ui.Halo(options);
    halo.render();

    // Adding a custom action.
    halo.addHandle({ name: 'myaction', position: 's', icon: 'myaction.png' });
    halo.on('action:myaction:pointerdown', function(evt) {
        if (cell.isLink()) {
            // do action

            // remove
            halo.options.cellView.model.remove();
        }
    });


For more information about the joint.ui.Halo please visit http://resources.jointjs.com/docs/rappid/v2.0/index.html#ui.Halo

Regards, 


 


Disclaimer : Privileged and Confidential information is contained in this e mail and/or attachments and is subject to legal privilege. This e mail is intended solely for the recipient/s mentioned above. If you are not the intended recipient or responsible for delivery of the message to the intended recipient you may not use, copy, distribute or deliver to anyone this e mail and/or any attachments or any part of its contents or take any action in reliance on it. In such case, you should destroy this message, and notify us immediately. All reasonable precautions have been taken to ensure no viruses are present in this e-mail. Our company is not liable for any loss arising from unauthorized access to our company’s email account by any third party and/or any loss caused due to the transmission of any viruses. The views, opinions, conclusions and other information expressed in this electronic mail that do not relate to the company’s business shall be deemed to be the personal opinion of the sender and not endorsed by the company.

--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Achyut G Patil

unread,
Nov 3, 2016, 3:20:28 AM11/3/16
to JointJS
Vladimir,

Will graph.on('remove') be executed after the following statement:

// remove
halo.options.cellView.model.remove();

I'm curious because, I have written few lines even inside graph.on('remove').
Now, removing an element using the logic you mentioned is probing a conflict with existing code.

Regards,
Achyut Patil 

Vladimir Talas

unread,
Nov 15, 2016, 8:19:15 AM11/15/16
to joi...@googlegroups.com

Hi,

yes, handler of graph.on('remove') will be executed in this case.


Vladimir

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sankalp Quality Policy:

Disclaimer : Privileged and Confidential information is contained in this e mail and/or attachments and is subject to legal privilege. This e mail is intended solely for the recipient/s mentioned above. If you are not the intended recipient or responsible for delivery of the message to the intended recipient you may not use, copy, distribute or deliver to anyone this e mail and/or any attachments or any part of its contents  or take any action in reliance on it. In such case, you should destroy this message, and notify us immediately.  All reasonable precautions have been taken to ensure no viruses are present in this e-mail. Our company is not liable for any loss arising from unauthorised access to our company’s email account by any third party and/or any loss caused due to the transmission of any viruses. The views, opinions, conclusions and other informations expressed in this electronic mail that do not relate to the company’s business shall be deemed to be the personal opinion of the sender and not endorsed by the company.



--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+u...@googlegroups.com.

Achyut G Patil

unread,
Nov 17, 2016, 3:05:58 AM11/17/16
to JointJS
Vladimir,

Thanks! There were few glitches in my code.
It's working Perfect now.

Regards,
Achyut Patil
Reply all
Reply to author
Forward
0 new messages