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
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
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?
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
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.
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
You
can obtain ej2.d.ts file from the following sources:
From the npm package
///<reference
path="ej2.d.ts"
|
you can now use IntelliSense
Please let me know, if you have any concerns.
Regards,
Shyam G
This is amazing...it seems to be working and I will press on and see what I can discover. Thx!!!
Hi Kabe,
We are happy to hear that your problem is resolved.
Regards,
Sivaranjith