在编辑extjs网格行之前调用组合框的combo.Setvalue在4.2中使用,但在6.2中没有
在4.2中编辑时,在beforeedit函数中调用的combo.setvalue(id)显示显示值,但在6.2中显示为空在编辑extjs网格行之前调用组合框的combo.Setvalue在4.2中使用,但在6.2中没有,extjs,extjs4.2,extjs6,Extjs,Extjs4.2,Extjs6,在4.2中编辑时,在beforeedit函数中调用的combo.setvalue(id)显示显示值,但在6.2中显示为空 combo.getStore().load(); combo.getStore().on('load', function(){combo.setvalue(id)}) 正在6.2中工作,但在行准备好编辑后需要时间。尝试使用此功能,存储从4.2更改为6.2,可能在设置onload侦听器之前加载完成 combo.getStore().load(function(){ c
combo.getStore().load();
combo.getStore().on('load', function(){combo.setvalue(id)})
正在6.2中工作,但在行准备好编辑后需要时间。尝试使用此功能,存储从4.2更改为6.2,可能在设置onload侦听器之前加载完成
combo.getStore().load(function(){
combo.setValue(id);
});
组合框也应该由valuefield设置,所以如果设置正确,请阅读组合配置。如果不必使用valuefield,则可以使用
combo.setRawValue(id);
More specified example
// The data store containing the list of states
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
]
});
// Create the combo box, attached to the states data store
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
listeners:{
render: function(combo){
combo.setValue('AL');
}
},
renderTo: Ext.getBody()
});