-
18 Jan 2012 8:23 AM #1
Answered: show popup instead of creating new one in html dom
Answered: show popup instead of creating new one in html dom
i have the following code:
i was expecting it to create the popup only if it hadn't previously done so... instead, everytime i close/reopen it is creating a new helpPopup div in the dom. how do i stop this?Code:if(!helpPopup){ var helpPopup = new Ext.Panel({ id: 'helpPopup', floating: params.floating, modal: params.modal, centered: params.centered, width: params.width, height: params.height, styleHtmlContent: params.styleHtmlContent, scroll: params.scroll, html: params.html, dockedItems: [{ dock: 'top', xtype: 'toolbar', title: params.title }] }); } helpPopup.show('pop');
-
Best Answer Posted by smerny
nevermind, fixed it this way..
Code:Demo = new Ext.Application({....Code:if(!Demo.helpPopup){ Demo.helpPopup = new Ext.Panel({ id: 'helpPopup', floating: params.floating, modal: params.modal, centered: params.centered, width: params.width, height: params.height, styleHtmlContent: params.styleHtmlContent, scroll: params.scroll, html: params.html, dockedItems: [{ dock: 'top', xtype: 'toolbar', title: params.title }] }); } Demo.helpPopup.show('pop');
-
18 Jan 2012 8:49 AM #2
nevermind, fixed it this way..
Code:Demo = new Ext.Application({....Code:if(!Demo.helpPopup){ Demo.helpPopup = new Ext.Panel({ id: 'helpPopup', floating: params.floating, modal: params.modal, centered: params.centered, width: params.width, height: params.height, styleHtmlContent: params.styleHtmlContent, scroll: params.scroll, html: params.html, dockedItems: [{ dock: 'top', xtype: 'toolbar', title: params.title }] }); } Demo.helpPopup.show('pop');


Reply With Quote