MyBatis + MVC 获取 UI 参数的几种方法(二)

           
方法一:(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){

}

 

posted @ 2013-01-25 16:00  xust  阅读(158)  评论(0)    收藏  举报