设置组合框的默认值
问题描述:
我试图设置使用商店的组合框的默认值。我尝试过value,defaultValue并试过afterrender,但似乎没有任何效果。有没有人遇到过同样的问题?任何帮助,将不胜感激。设置组合框的默认值
答
// 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"}
]
});
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
value: 'AL', // the value should be an existing store's valueField
renderTo: Ext.getBody()
});
我不知道为什么,我的问题是用户在这里降级。我已经把所有的信息。那么没有解决方案为我工作。 – ashhad