⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statefulportal.js

📁 一个简单的Ext例子
💻 JS
字号:
// Thanks: http://extjs.com/forum/showthread.php?t=25042
Ext.ux.StatefulPortal = Ext.extend(Ext.ux.Portal, {
    // configurables
    columnCount:2
    // {{{
    ,initComponent:function() {

        Ext.apply(this, {}
        ); // end of apply

        // call parent
        Ext.ux.StatefulPortal.superclass.initComponent.apply(this, arguments);

    } // end of function initComponent
    // }}}
    // {{{
    ,getConfig:function() {
        var pConfig = [[]]
        
        var col;
        for(var c = 0; c < this.items.getCount(); c++) {
            col = this.items.get(c);    
            pConfig[c] = [];
            if(col.items) {
                for(var s = 0; s < col.items.getCount(); s++) {
                    pConfig[c].push(col.items.items[s].getConfig());
                }
            }
        } 
        //pConfig值说明:
        //[
        // [{id:'portlet1'},{id:'portlet2'}], //第1列(打开了2个portlet)
        // [undefined] //第2列(无portlet打开)
        //]
        return pConfig;
    }
    // }}}
    // {{{
    ,afterRender: function() {

        // call parent
        Ext.ux.StatefulPortal.superclass.afterRender.apply(this, arguments);
        this.body.setStyle('overflow-y', 'scroll');

    } // end of function afterRender
    // }}}

}); // end of extend

// register xtype
Ext.reg('statefulportal', Ext.ux.StatefulPortal);  
//EOP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -