4
我的组合框的数据在表格布局后加载。表格布局后的EXTJS组合框默认值
var villeStore = new Ext.data.ArrayStore({
fields: [{name:'idVille'}
,{name: 'ville'}]
});
var villeInput = new Ext.form.ComboBox({
fieldLabel: 'Ville',
store: villeStore,
valueField:'idVille',
displayField:'ville',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Ville',
width:100,
id:'villeInput'
});
的问题是,我需要显示的最后一个店,但即使有valueField,因为当我点击一个按钮,这是我发送到服务器
我这样做,但它不工作,它显示最后储存价值,但不具备valueField
villeInput.store.on('load',function(store) {
villeInput.setValue(store.getAt(villeInput.store.getCount()-1).get('ville'));
});
它不给我任何东西:( – 2010-09-25 01:43:01