寫一個新的xtype

朱智文發表於2015-10-27
/**
 * 人員下拉選單分頁查詢
 *
 * @param {}
 *            config
 * @return {}
 */
oss.core.common.PersonsCombo = Ext.extend(Ext.form.ComboBox, {
    constructor: function(config) {
        var store = new Ext.data.Store({
            remoteSort: false,
            proxy: new Ext.data.HttpProxy({
                url: './param/param!queryPersonsByBranchForPage.action'
            }),
            reader: new Ext.data.JsonReader({
                root: 'data',
                totalProperty: 'totalProperty',
                fields: ['valueField', 'displayField']
            }),
            baseParams: config.baseParams
        });
        config = Ext.apply({
            store: store,
            lazyRender: true,
            emptyText: '請選擇',
            allowBlank: true,
            triggerAction: "all",
            typeAhead: true,
            editable: true,
            resizable: true,
            pageSize: oss.core.pageSize,
            minChars: 1
        }, config);
        oss.core.common.PersonsCombo.superclass.constructor.call(this, config);
    }

});


Ext.reg('personsCombo', oss.core.common.PersonsCombo);(這一句就是新建一個型別xtype)



相關文章