方法一:(Form 中必须放name与model的字段名称相同的控件)
{ xtype: 'hiddenfield', name: 'id', id: 'id', hidden: true }
var mNewRecord = new IniStore.model.Store();
mNewRecord.set('id', this.activeRecord.data.id);
mImportForm.loadRecord(mNewRecord);
mImportForm.submit({
url: '/IniStoreDetail/StoreDetailImport',
waitTitle: '温馨提示',
waitMsg: '正在导入信息,请稍后...',
success: function (form, action) {
Ext.Msg.alert('温馨提示', action.result.message);
this.getGoodsStore().load();
},
failure: function (form, action) {
Ext.Msg.alert('温馨提示', action.result.message);
},
scope: this
});
后台获取:
[HttpPost]
public string StoreDetailImport(Store mStore){
} 或
public string StoreDetailImport(){
// 设置查询参数
var mConditions = new StoreDetail();
TryUpdateModel(mConditions);
}
方法二:(Form 提交的时候设置参数 params)
mImportForm.submit({
url: '/IniStoreDetail/StoreDetailImport',
params: {
storeId: this.activeRecord.data.id
},
waitTitle: '温馨提示',
waitMsg: '正在导入信息,请稍后...',
success: function (form, action) {
Ext.Msg.alert('温馨提示', action.result.message);
this.getGoodsStore().load();
},
failure: function (form, action) {
Ext.Msg.alert('温馨提示', action.result.message);
},
scope: this
});
后台获取:public string StoreDetailImport(string storeId){
}