日期:2014-05-16  浏览次数:20359 次

extjs使利用cookie换皮肤

index.js

Ext.onReady(function() {
 Ext.BLANK_IMAGE_URL = 'images/s.gif';
 Ext.QuickTips.init();
 // 树形配置开始
 var functionTree = new Ext.tree.TreePanel({
    iconCls : 'usr-defined-menu',
    title : '功能菜单',
    region : 'west',
    id : 'menutree',
    autoScroll : true,
    enableDD : false,// 是否支持拖拽效果
    containerScroll : true,// 是否支持滚动条
    split : true,
    width : 180,
    minSize : 175,
    maxSize : 300,
    rootVisible : true,// 是否显示跟节点
    collapseMode : 'mini',// 在分割线处出现按钮
    collapsible : true,
    margins : '0 0 0 0',
    loader : new Ext.tree.TreeLoader({
       dataUrl : 'getFunctionTree.do'
      }),
    root : new Ext.tree.AsyncTreeNode({
       text : '功能树',
       id : '0',
       expanded : true
      }),

    tbar : [{
       text : '展开',
       handler : function() {
        functionTree.expandAll();
       },
       scope : this
      }, '-', {
       text : '收缩',
       handler : function() {
        functionTree.collapseAll();
       },
       scope : this
      }, '-', {
       xtype : "combo",
       fieldLabel : '皮肤',
       hiddenName : 'theme',
       width : 80,
       store : new Ext.data.SimpleStore({
          fields : ['text', 'value'],
          data : [
            ['绿色芳香', 'xtheme-green.css'],
            ['蓝色月影', 'xtheme-blue.css'],
            ['诱惑紫色', 'xtheme-purple.css'],
            ['灰色回忆', 'xtheme-gray.css'],
            ['深蓝心情', 'xtheme-slate.css'],
            ['深灰色', 'xtheme-darkgray.css'],
            ['靛青色', 'xtheme-indigo.css'],
            ['深夜', 'xtheme-midnight.css'],
            ['slickness',
              'xtheme-slickness.css']]
         }),
       forceSelection : true,// 输入值不能是选项中不存在的
       emptyText : '选