May 29, 2012, 2:18 PM
[CLOSED] Dynamic Theme
Hi,
In my mvc application I'm trying to change theme dinamically at all windows, tabs,... opened.
I have floatable windows that can have windows inside like the following example
How can I change the theme on it? Any idea?
In my mvc application I'm trying to change theme dinamically at all windows, tabs,... opened.
I have floatable windows that can have windows inside like the following example
<ext:Viewport runat="server" Layout="Fit">
<Content>
//... Some content
</Content>
<Items>
//... Some items
</Items>
</ext:Viewport>
<ext:Window ID="OrdenCalculoWindow" runat="server" Icon="Report" Title="<%$ AppRecursos : sm_txt_ordenCalculoContadores %>"
Width="550" Height="550" Hidden="true" Modal="true" CloseAction="Hide" Maximizable="true"
Constrain="true">
<AutoLoad Url='<%# this.Page.GetRouteUrl("Presencia", new { controller="ContadoresOrden", action="Index" }) %>'
Method="GET" Mode="IFrame" TriggerEvent="show" ReloadOnEvent="true" ShowMask="true"
AutoDataBind="true" MaskMsg="<%$ AppRecursos : sm_aviso_cargando||sm_txt_ordenCalculoContadores %>">
</AutoLoad>
</ext:Window>
And I'm using JS function that seems like this:changeTheme: function (theme) {
//HOME
top.Ext.net.ResourceMgr.setTheme(theme);
//TABS
tpMain.items.each(function (tab) {
if (!Ext.isEmpty(tab.iframe) && !Ext.isEmpty(tab.iframe.dom.contentWindow.Ext)) {
tab.iframe.dom.contentWindow.Ext.net.ResourceMgr.setTheme(theme);
//EMBEDDED WINDOWS
if (!Ext.isEmpty(tab.items)) {
tab.items.each(function (item) {
if (!Ext.isEmpty(item.getEl()) && !Ext.isEmpty(item.getEl().dom.contentWindow.Ext))
item.getEl().dom.contentWindow.Ext.net.ResourceMgr.setTheme(theme);
});
}
}
});
//WINDOWS
top.Ext.WindowMgr.each(function (win) {
if (!Ext.isEmpty(win.iframe)) {
win.iframe.dom.contentWindow.Ext.net.ResourceMgr.setTheme(theme);
//EMBEDDED WINDOWS
if (!Ext.isEmpty(win.items)) {
win.items.each(function (item) {
if (!Ext.isEmpty(item.getEl()) && !Ext.isEmpty(item.getEl().dom.contentWindow.Ext))
item.getEl().dom.contentWindow.Ext.net.ResourceMgr.setTheme(theme);
});
}
}
});
},
But I fail with embedded windows inside a floatable window.How can I change the theme on it? Any idea?
Last edited by Daniil; Jun 01, 2012 at 3:10 PM.
Reason: [CLOSED]