I have modal dialog in Liferay 6.2 Is there any way to set destoryOnHide or destroyOnClose to dialog, but after render process?
Asked
Active
Viewed 878 times
2 Answers
3
If you have a reference to the Dialog object, you can use the set Operation. For example:
var dlg = Liferay.Util.Window.getWindow({ id: 'd123', ..your-config-obj.. });
// now it is rendered
dlg.set('destroyOnHide', false);
Unfortunatelly, i did not see a similar thing for destroyOnClose, but you can try to do this in same way. If you dont have a reference to the dialog, you can get one with (for Example)
Liferay.Util.Window.getById('d123');
Also make sure you have a dependency to 'liferay-util-window' in your script.

Andre Albert
- 1,386
- 8
- 17
0
Thank you for answer. This code works in my case:
var modal = Liferay.Util.getWindow('windowID');
modal._state.data.destroyOnHide.lazy.value = true;

standart5
- 31
- 4