Ext.Ws.CommonDatabox = Ext.extend(Ext.form.ComboBox, {
valueField : "value",
displayField : "key",
triggerAction : "all",
emptyText : "请选择",
anchor : '100%',
editable : false,
mode : 'remote',
url : '',
initComponent : function() {
Ext.Hs.CommonDatabox.superclass.initComponent.apply(this,
arguments);
this.store = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : this.url
}),
reader : new Ext.data.JsonReader({
root : 'list',
totalProperty : 'totalCount',
fields : [{
name : this.valueField || 'value'
}, {
name : this.displayField || 'key'
}]
})
})
}
});
Ext.reg('commonbox', Ext.Ws.CommonDatabox);
selected:function(){
var val = this.value;
ajax......
}
这种效果?