日期:2014-05-16 浏览次数:20458 次
{ name: 'submitterId', fieldLabel: '提交人', xtype: 'combo', triggerAction: 'all', queryMode: 'remote', hiddenName : 'id', minChars : 1, queryParam: 'nickname', store: submitterStore = Ext.create('Ext.data.Store', { proxy: { type: 'ajax', url: 'saler/getQuerySalers.json', method: 'POST', reader: { type: 'json', totalProperty : 'page.totalCount', root: 'page.result' } }, pageSize : 2, fields :[{ name : 'id' }, { name : 'nickname' }] }), valueField: 'id', displayField: 'nickname', listConfig : { minWidth: 280 }, pageSize : 2 }
Ext.apply(Ext.form.field.ComboBox.prototype, { doQuery: function(queryString, forceAll) { queryString = queryString || ''; var me = this, qe = { query: queryString, forceAll: forceAll, combo: me, cancel: false }, store = me.store, isLocalMode = me.queryMode === 'local'; if (me.fireEvent('beforequery', qe) === false || qe.cancel) { return false; } queryString = qe.query; forceAll = qe.forceAll; if (forceAll || (queryString.length >= me.minChars)) { me.expand(); if (!me.queryCaching || me.lastQuery !== queryString) { me.lastQuery = queryString; if (isLocalMode) { if (forceAll) { store.clearFilter(); } else { store.clearFilter(true); store.filter(me.displayField, queryString); } } else { Ext.apply(store.getProxy().extraParams, me.getParams(queryString)); store.load(); } } if (me.getRawValue() !== me.getDisplayValue()) { me.ignoreSelection++; me.picker.getSelectionModel().deselectAll(); me.ignoreSelection--; } if (isLocalMode) { me.doAutoSelect(); } if (me.typeAhead) { me.doTypeAhead(); } } return true; } });