PDA

View Full Version : [CLOSED] Theme gray + textfield with icon defined in iconCls



supera
Feb 18, 2013, 1:06 PM

Daniil
Feb 18, 2013, 1:30 PM
Hi @supera,

The setTheme method is fixed in SVN.

For you I can recommend to set up the Theme property of the ResourceManager.

Or use the following overriding.

Fix

Ext.net.ResourceMgr.setTheme = function (url, name, rtl, debug) {
var lowerUrl,
path = this.cdnPath || this.resourcePath,
ss,
suffix,
html;

if(this.theme == "neptune" || name == "neptune")
{
return;
}

url = url || "";
lowerUrl = url.toLowerCase();
suffix = (rtl ? "-rtl" : "") + (debug ? "-debug" : "");

if (Ext.isEmpty(lowerUrl) || lowerUrl == "blue" || lowerUrl == "default" || lowerUrl == "classic") {
url = path ? (path + "/extjs/resources/ext-theme-classic/ext-theme-classic-all" + suffix + ".css") : "~/extjs/resources/ext_theme_classic/ext-theme-classic-all" + suffix +"-embedded-css/ext.axd";
name = "classic";
}
else if (lowerUrl == "gray") {
url = path ? (path + "/extjs/resources/ext-theme-gray/ext-theme-gray-all" + suffix + ".css") : "~/extjs/resources/ext_theme_gray/ext-theme-gray-all" + suffix +"-embedded-css/ext.axd";
name = "gray";
}
else if (lowerUrl == "access") {
url = path ? (path + "/extjs/resources/ext-theme-access/ext-theme-access-all" + suffix + ".css") : "~/extjs/resources/ext_theme_gray/ext-theme-access-all" + suffix +"-embedded-css/ext.axd";
name = "access";
}

url = this.resolveUrl(url);
html = document.body.parentNode;

if (this.theme) {
Ext.fly(html).removeCls("x-theme-" + this.theme);
}

if (name) {
this.theme = name;
Ext.fly(html).addCls("x-theme-" + this.theme);
}

//Ext.util.CSS.swapStyleSheet("ext-theme", url);
//Ext.util.CSS.removeStyleSheet(id);
ss = document.createElement("link");
ss.setAttribute("rel", "stylesheet");
ss.setAttribute("type", "text/css");
ss.setAttribute("id", "ext-theme");
ss.setAttribute("href", url);
document.getElementsByTagName("head")[0].replaceChild(ss, document.getElementById("ext-theme"));
}

Vladimir
Feb 18, 2013, 1:35 PM
Set theme via Theme property in ResourceManager instead setTheme using.
Ideally, page must be reloaded if you want to change a theme (setTheme changes theme on the client side)

Why do you use setTheme javascript method?

supera
Feb 18, 2013, 4:00 PM
hi Daniil/Vladimir...

setting tag 'resourcemanager' in aspx page, property 'theme', works very fine...


<ext:ResourceManager ID="resManagerSGE" Theme="Gray" runat="server" />

Thanks a lot for your help