statefulportal.js

来自「一个简单的Ext例子」· JavaScript 代码 · 共 53 行

JS
53
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?