|
To enable/disable dialog footer button
document.getElementById('enablebtn').onclick = (): void => {
// To check and enable button by removing disabled attribute
if(dialog.ftrTemplateContent.children[1]) {
dialog.ftrTemplateContent.children[1].removeAttribute("disabled");
}
}
document.getElementById('disablebtn').onclick = (): void => {
// To check and disable button by setting disabled attribute as true
if(dialog.ftrTemplateContent.children[1]) {
dialog.ftrTemplateContent.children[1].setAttribute("disabled", true);
}
} |
|
[component.html]
<ejs-dialog id='dialog' #ejDialog [content]='content'[header] = 'header' [footerTemplate] = 'footerValue'
[target]='targetElement' width='330px' visible= 'true' isModal= 'true' showCloseIcon = 'true' (close) = "showButton($event)" >
</ejs-dialog>
[component.ts]
public targetElement : string = "#container"
public header: string = 'Modal Header';
public footerValue: string = '<button class="e-control e-btn e-primary" id="okButton" role="button" e-ripple="true" >Okay</button> <button class="e-control e-btn" id="cancelButton" role="button" e-ripple="true" disabled>Cancel</button>';
public content: string = 'Are you sure want to close this Dialog?';
public showCloseIcon: boolean = true;
public width: string = '330px';
ngAfterViewInit() {
setTimeout(() => {
document.getElementById("okButton").onclick = () => {
this.ejDialog.hide();
}
}, 100);
}
|