extjs 3.4组合框加载问题

时间:2014-03-19 07:28:40

标签: extjs combobox

我正在使用extjs 3.4组合框。我检查组合商店加载焦点.combo有价值,但它显示在焦点事件中写的消息。我想在选择组合之前检查如果组合有价值它不显示消息。其他手combo返回消息请至少创建值。 这是我的代码。

抱歉我的英语不好。

Ext.form.ComboBox({
id:"comboCB",
hiddenName:'comboCBId',
store: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: '',
timeout :12000,

success: function(response) {
console.log("Spiffing, everything worked");
isloaded = true;
},

failure: function(response) {
console.log("Curses, something terrible happened");
},

callback: function(response) {
console.log("It is what it is");
}
}),
reader: new Ext.data.JsonReader({
id: "id",
root: 'rows',
totalProperty: 'total'
}, Ext.data.Record.create([
{
name: "id",
mapping: "id",
type: "string"
},
{
name: "name",
mapping: "name",
type: "string"
}])),
remoteSort: false,
autoLoad : true,
}),
emptyText:'Select Value ...',
fieldLabel:'Value',
displayField: 'name',
valueField: 'id',
typeAhead: true,
editable: false,
forceSelection: true,
triggerAction: 'all',
mode:'remote',

maxLength: 50,
anchor : '90%',
selectOnFocus:true,
listeners: {
change: function(combo, newValue, oldValue){

},

select: function(combo, record, index){

},
focus: function(combo){
if(combo.getStore().getTotalCount() == 0){
Ext.MessageBox.show({
title: 'Message',
msg: 'Please add one Value',
buttons: Ext.MessageBox.OK,
icon: 'error'
});
return
}
}
}
})

0 个答案:

没有答案