Closing a dialog with a custom body

  • 1 February 2018
  • 5 replies
  • 60 views


I need to hide a dialog with a custom body. I can show it with


client.interface.trigger("showDialog", {title: "Title", template: "dialog.html"});


I can close the dialog with the 'x' at the top right, but I'd need to add my own OK button at the bottom. Clicking this will send a message back to the parent, but I don't know how to then close the dialog.




I also tried using


client.interface.trigger("showConfirm", {title: "Title", message: "Message"})


This shows the Cancel and OK buttons at the bottom, but I cannot specify my own content. Only a message.




How do I go about showing a dialog with my own content and also be able to close it when clicking OK?



This topic has been closed for comments

5 replies


Hi Jeff,




This feature (API to close a modal) is currently in development. I will post an update here once it is available.



Thank you for the feedback Rohit.




We're busy evaluating Freshdesk to see if it can meet our needs and being able to write custom apps is something we need. The ability to close a dialog is a very fundamental function and I find it strange that the API is made available to open a dialog without the API to close it.




Do you have any timeline on when this would be available? Our evaluation license isn't going to last much longer and I'd like to see if we can accomplish what we need before it expires.






Hi Jeff,


You are right, it is indeed a basic requirement and it was an oversight on our part that led to it not being available. Development has now started and I will give you an ETA as it gets closer to being live. 


In the meantime, I can help extend your evaluation period to ensure that you get to try out the custom app. Please let me know if I can help in any  way.

 


Great to hear this is in development. Are we looking at weeks or months for this to go live?


This API is now live

client.instance.close();


Full details at https://developers.freshdesk.com/v2/docs/instance-api/