0
我想如下顯示在組合框中的值:組合框顯示爲空 - Ext.JS 4
Ext.define('Pgmtems.view.combo.DepoTurCombo', {
extend : 'Ext.form.field.ComboBox',
alias : 'widget.depoturcombo',
fieldLabel : 'Depo Cinsi',
displayField : 'aciklama',
valueField : 'value',
typeAhead : true,
forceSelection : true,
enableKeyEvents : true,
emptyText : '-Depo Cinsi-',
editable : false,
labelWidth : 70,
constructor : function(cfg) {
console.warn(cfg.xtype, " constructor arld.");
var me = this;
Ext.apply(this, cfg);
var store = Ext.create('Ext.data.Store', {
autoLoad : true,
fields : ['value', 'aciklama'],
data : [[3, "TL"], [2, "YTL"], [1, "ETL"]]
});
Ext.apply(this, {
store : store
});
this.callParent(arguments);
},
initComponent : function() {
console.log('DepoTurCombo initComponent');
this.trigger1Cls = 'x-form-clear-trigger';
this.trigger2Cls = 'x-form-arrow-trigger';
this.callParent(arguments);
},
onTrigger1Click : function() {
this.clearValue();
}
});
但是,它不顯示組合框的值。正如你所看到的,Depo Cinsi值是空的(實際上我可以看到3個項目,但是他們的名字沒有出現)。
關於如何解決這個問題的任何想法?
謝謝您的回答,但我想要使用Ext.data.Store,因爲我將修改此示例以稍後從代理中讀取數據。 – supaplexy