How completely dispose the dialog component instead of calling just hiding it?

I can see the dialog is just being hidden when the X is clicked or if Hide() method is called. Is there a way to completely remove it from the DOM?

4 Replies

IS Indrajith Srinivasan Syncfusion Team May 8, 2020 12:28 PM UTC

Hi j,

Greetings from Syncfusion support,

We have validated your reported query. Yes, you can remove the dialog from DOM and render it again on a button click. We have achieved your requirement by maintaining a Boolean variable, above the SfDialog and true/false when it is shown/hidden. Can you please check the below sample?

Sample: https://www.syncfusion.com/downloads/support/forum/154066/ze/Dialog_dynamic_render427313674

Please let us know if the solution helps and meets your requirements?

Regards,
 
Indrajith 



J j May 9, 2020 04:54 AM UTC

Thank you. But this seems to be more on workflow not entirely a component-related. But that's very much okay. Thank you very much.


J j May 9, 2020 04:56 AM UTC

But what's the diff bet the visible property and Hide() method?


IS Indrajith Srinivasan Syncfusion Team May 11, 2020 11:48 AM UTC

Hi J, 
 
Thanks for the update, 
 
Query: “But what's the diff bet the visible property and Hide() method?“ 
 
The Hide method in SfDialog can be called using the @ref object. But the Visible property can be updated using a property binding approach. So, we suggest you use the Visible property while comparing it with the Hide method. 
 
Please let us know if you need any further assistance. 
 
Regards, 
Indrajith 


Loader.
Up arrow icon