We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Getting started with userHandles - help

Hi,

I would like to implement the link userHandle in my application.
I've lifted the code from your DiagramBuilder sample that creates the handle (by the way, you give it a name of Line rather than Link).
I've also added the following 3 statements in my load event:

    // Add the link handle
    createLinkHandle(); // Code lifted directly from the SF DiagramBuilder sample app
    diagram.model.userHandles = userHandles;
    diagram._initHandles();

My selection change handler looks like this:

    function selectionChangeHandler(args) {
        var handles = diagram.model.userHandles;
        handles[0].visible = true;
        diagram.updateUserHandles(args.element);
    }

When I run the app and select a single node, the handle does not show.
I realize I need to be making a lot more checks in my handler above, but for now I'm just trying to get the link handle working when I click on a node.

I'm obviously missing something.
What would that be?

Thanks in advance.

Jim



3 Replies

SG Shyam G Syncfusion Team February 9, 2015 01:24 PM UTC

Hi Jim

Thanks for using Syncfusion products.

Please note that we have made API changes for selector related properties (userHandles, selectorConstraints) in our latest release 12.4.0.24 and these properties  are moved from diagram model to selectedItems. Please refer the below sample and code snippet.

Code snippet:

var userHandles = [];

        $(window).load(function () {

            var diagram = $("#Diagram1").ejDiagram("instance");

            createUserHandles();

            diagram.model.selectedItems.userHandles = userHandles;

            diagram._initHandles();

        });

Sample:http://www.syncfusion.com/downloads/support/directtrac/118169/WebApplication2-1618908303.zip

We have provided the online UG documentation which represents how to use the “Selector”.

Documentation: http://help.syncfusion.com/ug/js/documents/selector.htm

Please refer the below Release notes link to view the breaking changes that we have made in our latest release 12.4.0.24.

Release notes link: https://s3.amazonaws.com/files2.syncfusion.com/Installs/v12.4.0.24/ReleaseNotes/JavaScript.html#JS-Diagram

Please let me know if any concerns.

Regards,

Shyam G


JJ Jim Jacobs February 9, 2015 11:48 PM UTC

Hi Shyam,

That did the trick.
Thanks.

Jim



SG Shyam G Syncfusion Team February 10, 2015 04:26 AM UTC

Hi Jim

Thanks for the update

Please let me know if you require further assistance on this.

Regards,

Shyam G



Loader.
Live Chat Icon For mobile
Up arrow icon