- Home
- Forum
- JavaScript - EJ 2
- How do add nice popup custom control to show a form on shape click
How do add nice popup custom control to show a form on shape click
How do add nice popup custom control to show a form on shape/node click and then in that poup form user can select start and end dates and few dropdowns like(monthly/yealrly/weekly) and one text box and that data needs to come back into shape/node text. This is ej2 javascript jquery based.
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
GG
Gowtham Gunashekar
Syncfusion Team
April 1, 2021 01:57 PM UTC
Hi Amit,
We have added a sample link, in it when click on the node a popup will open, if we select yes in the first popup ,second popup will open, the second popup has multiple check box and two text box, if users select some option and click yes means the selecte data stroed in the addinfo property of the node
Code snippet:
|
document.getElementById("ok").onclick = function() {
var node = diagram.selectedItems.nodes[0];
node.addInfo = [{ Day: day, StartTime: startTime, endTime: endTime }];
diagram.dataBind();
templateDialog.hide();
}; |
Sample link: https://stackblitz.com/edit/ndzfuk
Regards,
Gowtham
AK
Amit K Lohogaonkar
April 5, 2021 10:42 AM UTC
great! Thanks. I want this poup on userhandles
https://ej2.syncfusion.com/javascript/demos/#/material/diagram/quick-commands.html
AK
Amit K Lohogaonkar
April 5, 2021 11:09 AM UTC
I was able to make it work in userhandles but one issue in your sample is for all nodes its taking same date. I need seperate dates for each node, for one action it may be friday and for one its monday etc..
AK
Amit K Lohogaonkar
April 5, 2021 12:18 PM UTC
One issue with userhandles is it adds it to arrows as well... How do I add it only to node shapes?

GG
Gowtham Gunashekar
Syncfusion Team
April 6, 2021 01:24 PM UTC
Hi Amit,
We have added a sample to demonstrate how to change the day radio button’s checked value before the dialog box shown and how to restrict the user handle for the connectors.
Code snippet:
|
function getTool(action) {
var tool;
if (action === "clone") {
// set the day value before dialog box open using selected node id
if (
diagram.selectedItems.nodes[0].id === "sdlc" ||
diagram.selectedItems.nodes[0].id === "support"
) {
document.getElementById("monday").ej2_instances[0].checked = true;
} else {
document.getElementById("sunday").ej2_instances[0].checked = true;
}
dialogObj.show();
}
return tool;
}
function click(args) {
if (args.element.inEdges) {
// show the userhandle when select the connector
diagram.selectedItems.userHandles[0].visible = true;
} else {
// hide the userhandle when select the connector
diagram.selectedItems.userHandles[0].visible = false;
}
} |
Regards,
Gowtham .
Marked as answer
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
- Marked answer
-
AK Amit K Lohogaonkar
- Mar 31, 2021 09:44 AM UTC
- Apr 6, 2021 01:24 PM UTC