1、先加载了省级ComboBox,在使用addEmployeeFormPanel.getForm().loadRecord(record);,绑定后只能显示value,而无法显示name
只需要在ComboBOx的store中callback执行addEmployeeFormPanel.getForm().loadRecord(record);如下
var record = grid.getSelectionModel().getSelected();
var value = record.get(‘province‘);
cityStore.load({
params : {
pareaId : value
},
callback: function(r, options, success){
if(success){
if (Ext.isEmpty(record)) {
Ext.Msg.alert(‘提示‘, ‘请先选中要修改的项目‘);
return;
}
record = grid.getSelectionModel().getSelected();
addEmployeeWindow.show();
addEmployeeFormPanel.getForm().loadRecord(record);
Ext.getCmp(‘windowmode‘).setValue(‘edit‘);
}else{
Ext.Msg.alert(‘城市数据载入失败‘,‘失败!‘);
}
}
});