BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
I cannot find documentation that addresses adding a handler for the click event on a node. Can you please provide an example?
Hi Jeff
Thanks for using Syncfusion Products.
We are glad to inform you that we have created a simple sample in which we have fired click event for a node. Please see the code snippet below
model.Click = "onclick";
function onclick(args) {
if(args.element.shape)
alert("nodeeventfired");
}
Please let me know if any concerns.
Regards,
Shyam G
Hi Jeff
Please ignore our previous update.
We are glad to inform you that we have created a simple sample in which we have fired click event for a node. Please see the code snippet below
model.Click = "onclick";
function onclick(args) {
if(args.element.shape)
alert("nodeeventfired");
}
Please let me know if any concerns.
Regards,
Shyam G
Thanks for the example.
I assume the purpose for the following test is to determine whether the element is a node:
if(args.element.shape)
Since connectors do not have a shape property, based on the current API this test would accurately distinguish between the two types that raise the click event -- nodes and connectors.
However, this approach is error-prone, because you as a vendor could do one of the following that would break my code:
I very much prefer the approach in MVC Classic, where there were separate NodeClick and ConnectorClick events.
If that is not possible, I suggest you add a property to args, indicating the element type. As a customer, I want a guarantee that your event is handing me the type I expect.
Hi Jeff
Thanks for the update.
We are glad to inform you that we have created a sample in which click event is fired for both nodes and connectors. Please see the code snippet below
$("#diagram").ejDiagram({
click: onNodeClick,
});
function onNodeClick(args) {
if (args.element.shape) {
alert("node event fired");
}
if (args.element.line) {
alert("connectoreventfired");
}
}
Please let me know if any concerns.
Regards,
Shyam G