We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Dialog set enable modal dinamically not working.

Hi,

I was looking the documentation for the dialog.
https://help.syncfusion.com/js/api/ejdialog#members:enablemodal

$("#dialog").ejDialog({enableModal: true});
What I want is enable the model property depending some parameters.

I have a method that opens the dialog from Onclick function openDialogWithMessageHistoryVersion.

function openDialogWithMessageHistoryVersion(changeTitle, type) {
        var data = $("#GridShowDocumentHistory").ejDialog("instance");
        data.setTitle(changeTitle);
        if(type==0)
        {
        $("#GridShowDocumentHistory").ejDialog("open", { enableModal: false});
        }       
        else if (type == 1)
        {
        $("#GridShowDocumentHistory").ejDialog("open", { enableModal: true });
        }
    }

The dialog opens fine, but the enable model property is never active.

Could you tell me what could be the issue.

Kind regards,

Juan


1 Reply

RJ Rekha J Syncfusion Team October 7, 2016 11:04 AM UTC

Hi Juan,   
Thanks for using Syncfusion products.    
Query: Dialog set enable modal dynamically not working.   
We have checked the mentioned problem. The issue is due to incorrect usage of the properties with method in our control. You have used the enableModal property with the open method “(("#GridShowDocumentHistory").ejDialog ("open", {enableModal: false}) ;”. You can’t use properties of controls and method "open" in that same line of code). Instead of it, please set the properties and method consecutively.         
For your convenience, we have provided the code snippet for achieving your requirement.   
Code Snippet:   
   
      if (event.data.type == 1) {               
            $("#basicDialog").ejDialog("open");   
            $("#basicDialog").ejDialog({ enableModal: true });   
       }   
   
  
For your reference, we have created a sample using Dialog control. You can get this sample from the following location,   
Please let us know if you have any queries,  
Regards,   
Rekha. 


Loader.
Live Chat Icon For mobile
Up arrow icon