Hiding FixedUserHandles

I'm attempting to hide a node and it's fixed userhandle when clicking the userhandle.

The node disappears but the handle does not.

 

To test this out, I'm using:

    <div class="diagram-section">
        <ejs-diagram id="container" width="100%" height="100%" fixedUserHandleClick="uhclick" selectionChange="selectionChange" nodes="@Model.Nodes" connectors="@Model.Connectors">
            <e-diagram-selecteditems constraints="Rotate"></e-diagram-selecteditems>
        </ejs-diagram>
    </div>


and

    function uhclick(args) {
        var node = diagram.nodes[1];
        node.visible = false;

        var uh = node.properties.fixedUserHandles[0];
        uh.properties.visibility = false;
       }


I expected the fixedUserHandles to disappear when the node visible is set to false. No problem though, but how do I make the nodes fixedUserHandles hidden as well


7 Replies 1 reply marked as answer

AR Aravind Ravi Syncfusion Team August 15, 2022 08:07 AM UTC

Hi Kabe,


Once we click on the + icon (fixed user handle) on the node, fixedUserHandleClick event gets triggered. In the click event, through element argument you can able to get the node. By using the node’s visible property you can able to hide the node and through fixedUserHandle’s visibility property you can able to hide the fixedUserHandle. Please refer to below code snippet

function fixedUserHandleClick(args) {

  let node= args.element;

    node.visible = false;

    node.fixedUserHandles[0].visibility = false;}

}


Regards

Aravind Ravi



KA Kabe replied to Aravind Ravi August 17, 2022 03:08 PM UTC

Hi - thanks! That worked perfectly. I appreciate the quick response.

I'm using Visual Studio 2022 and there is no intellisense (aka autocomplete) it would seem. Is this possible? Or am I better off referring to the API documentation?



SJ Sivaranjith Jeyabalan Syncfusion Team August 18, 2022 02:01 PM UTC

Hi Kabe,

Could you please confirm us whether you are not getting intellisense in the controller file for diagram class or javascript in cshtml file?


Regards,

Sivaranjith



KA Kabe August 18, 2022 03:42 PM UTC

Oh! thanks - I'm talking about the javascript in the cshtml.

I probably wasn't clear but my question was spawned by my earlier question..I was trying to hide a fixeduserhandle in javascript but wasn't able to use intellisense to help guide me.





SG Shyam G Syncfusion Team August 19, 2022 01:44 PM UTC

Hi Kabe,


Visual Studio 2017 provides improved JavaScript IntelliSense based on information declared in TypeScript definition files (or .d.ts files).

Follow the instruction below to enable IntelliSense for create JavaScript functions that relay on EJ2 

  1. Add the ej2.d.ts definition files to your project.



You can obtain ej2.d.ts file from the following sources:

From the npm package 

  • Execute the command below in the npm CLI to install the package.
    npm i @syncfusion/ej2-js-es5
  1. Add the following string to each script file or script block where you are going to use IntelliSense:


 ///<reference path="ej2.d.ts" 

  1. <script type="text/javascript">
  2.  
  3.     /// <reference path="../../ej2.d.ts"/>
  4.  
  5.     var ajax = new ej.base.Ajax("index.html""GET"true);
  6.  
  7. </script>

you can now use IntelliSense






 


Please let me know, if you have any concerns.


Regards,

Shyam G


Marked as answer

KA Kabe August 19, 2022 05:17 PM UTC

This is amazing...it seems to be working and I will press on and see what I can discover. Thx!!!



SJ Sivaranjith Jeyabalan Syncfusion Team August 22, 2022 03:17 PM UTC


Hi Kabe,


We are happy to hear that your problem is resolved.


Regards,

Sivaranjith


Loader.
Up arrow icon