I have a dojo ConfirmDialog as below:
this.myDialog = new ConfirmDialog({
title: "My Dialog",
content: "Do you want to continue?",
class: "confirmDialog",
closable: false
});
// change button labels
this.myDialog.set("buttonOk","Yes");
this.myDialog.set("buttonCancel","No");
// register events
this.myDialog.on("execute", function() {
self.continueSomething()
});
Later on based on some condition, I am updating the ConfirmDialog dynamically as below:
this.myDialog.set("title", "New Title");
this.myDialog.set("content", "Its too late. Press ok to re-route.");
this.myDialog.set("buttonOk","Ok");
At this stage, I do not have any function for the Cancel button. How do I hide it?
None of the following work:
this.myDialog.cancelButton.hide();
//or
this.myDialog.cancelButton.set("display", "none");
//or
this.myDialog.cancelButton.set("display", none);
I am able to disable it as:
this.myDialog.cancelButton.set("disabled", true);
But that does not look correct. I want to hide the Cancel button completely.
How can I do it?
The
cancelButtonis abutton Dijit, if you want to hide / show this last , you've to access it's domNode by smply typingthis.myDialog.cancelButton.domNodeand use thedojo/dom-styleto hide /show as belowsee below working wnippet (disable enable using external button )