Extjs 组合框查询覆盖
如何返回查询值和当前组合框名称? 我有远程存储的组合框Extjs 组合框查询覆盖,extjs,extjs4,extjs-mvc,Extjs,Extjs4,Extjs Mvc,如何返回查询值和当前组合框名称? 我有远程存储的组合框 { xtype: 'combobox', fieldLabel: 'Some label', editable: false, name: 'my_combo', matchFieldWidth: false, displayField: 'foo', mode: 'remote', store: 'fooStore', valueField: 'foo2' } 此时
{
xtype: 'combobox',
fieldLabel: 'Some label',
editable: false,
name: 'my_combo',
matchFieldWidth: false,
displayField: 'foo',
mode: 'remote',
store: 'fooStore',
valueField: 'foo2'
}
此时,它返回带有参数的url
query=my%20search
page=1
start=0
limit=25
如何返回
query=[{'my_combo':'my search'}]
page=1
start=0
limit=25
也许有一种侵入性较低的方法可以满足您的需要,但我是如何解决一个类似的请求以拦截并覆盖发送到服务器的查询的: 从Ext.form.field.ComboBox扩展的自定义字段定义
initComponent:function () {
this.on({
beforequery:function(queryEvent){
if (queryEvent.query) {
//uppercase typed in value
queryEvent.query = queryEvent.query.toUpperCase().replace(" ","","g"); //.trim(); --errors out in IE9 compat mode
queryEvent.combo.setValue(queryEvent.query);
}
Ext.Ajax.abortAll(); //cancel any previous requests
return true;
}
});
}
谢谢!我通过
监听器用'beforequery':函数(queryevent)…解决了这个问题。
但要点是一样的。