Refresh Dialog

Is there a way to refresh a dialog content that has a content type of ajax. I have tried $(dialogId).ejDialog("refresh"); but that doesn't appear to call the ContentUrl again to refresh the content.

5 Replies

SS Selvamani Sankarappan Syncfusion Team March 30, 2018 07:50 AM UTC

Hi Aaron, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query. To be clearer, the refresh method refreshes the same dialog content with scroller based on the dialog content dimensions. It’s does not call the contentUrl or change the dialog content. Use the contentUrl property to change the content to which action you want to change. We have prepared the sample and changed the dialog content while clicking the button. Please refer to the following sample: 
 
If the above does not meet your requirement, kindly share us the more details about your requirement or provide the modified sample based on your application to provide an appropriate solution at the earliest. 
 
Regards, 
 
Selvamani S. 



AK Aaron Khan March 30, 2018 06:58 PM UTC

I have tried this and it works only if the contentUrl I pass it is different from the current contentUrl. What I am trying to do is have it reload from the same url. 


AP Arun Palaniyandi Syncfusion Team April 2, 2018 10:27 AM UTC

Hi Aaron Khan, 
 
Thanks for your update. 
 
 
Query1 : “I have tried this and it works only if the contentUrl I pass it is different from the current contentUrl.” 
 
We have validated this scenario and hence it is the behavior our setmodel. As per our EJ core standards, our setmodel will not allow the same value to be used.(i.e same contentUrl value). 
 
 
Query2:” What I am trying to do is have it reload from the same url.” 
 
For this case we suggest you to use the simple direct AJAX call to get the data from our URL and on success event we can append the data using the setContent public method. 
 
 
 
 
 
 
 
 
    function onclick1(e) { 
 
        $.ajax({ // use jQuery AJAX 
            type: 'GET', 
            url: "http://localhost:62007/api/Orders", //our contentUrl 
            success: function (data) { 
 
                $("#createDialog").ejDialog("setContent", data);   // set the content using setContent method 
                $("#createDialog").ejDialog("refresh");  // refresh the Dialog to render the scroller properly 
            }, 
        }); 
    } 
 
 
 
 
 
We have also prepared a sample below for your reference. 
 
 
 
Please let us know if you need any further assistance. 
       

Regards,
Arun P.
 



AK Aaron Khan April 2, 2018 02:33 PM UTC

This works great. Is there a way to show a waiting animation in the dialog while the content is loading?


AP Arun Palaniyandi Syncfusion Team April 3, 2018 06:41 AM UTC



Loader.
Up arrow icon