|
根据实际需要动态生成CSS
引用方法: 'iconCls':'tab_iconCls_icon_'+icon,
//根据图标生成Css
string iconScript = "";
foreach (string sIcon in lsticons)
{
string iconUrl = ExtAspNet.IconHelper.GetIconUrl(ExtAspNet.IconConvertor.String2Icon(sIcon, true));
string className = String.Format("tab_iconCls_icon_{0}", sIcon);
iconScript += String.Format("X.util.addCSS('{0}','{1}');", className, ExtAspNet.StyleUtil.GetNoRepeatBackgroundStyle("." + className, ResolveUrl(iconUrl)));
}
if (iconScript.Length > 0)
{
ExtAspNet.PageContext.RegisterStartupScript(iconScript);
} |
|