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

// 导入
    onImport: function (button, e, eOpts) {
        var mMainGrid = Ext.getCmp('storeMainGrid');
        var mSelections = mMainGrid.getSelectionModel().getSelection();

        if (mSelections.length > 0) {
            var mWin = Ext.getCmp('winImport');
            mWin.show();
        }
        else
            Ext.Msg.alert('温馨提示', '请选择一条记录!');
    },

    // 导入
    onImportConfirm: function (button, e, eOpts) {
        var mWin = Ext.getCmp('winImport');
        var mFile = Ext.getCmp('fileUpload');
        var mFileName = mFile.getValue();

        if (mFile && mFileName != '') {
            //Ext.Msg.alert('温馨提示', '您选择了导入文件!');
            var mImportForm = Ext.getCmp('importForm').getForm();
            mWin.hide(); //关闭弹出窗口

//            var mNewRecord = new IniStore.model.Store();
//            mNewRecord.set('id', this.activeRecord.data.id);
//            mImportForm.loadRecord(mNewRecord);

            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
            });
        }
        else
            Ext.Msg.alert('温馨提示', '您没有选择任何导入文件!');
    },

    // 导入
    onImportCancel: function (button, e, eOpts) {
        var mWin = Ext.getCmp('winImport');
        mWin.hide();
    },

    // 导出
    onExport: function (button, e, eOpts) {
        var mImportForm = Ext.getCmp('importForm').getForm();
        mImportForm.submit({
            url: '/IniStoreDetail/StoreDetailExport',
            //waitTitle: '温馨提示',
            //waitMsg: '正在导出信息,请稍后...',  
            success: function (form, action) {
                Ext.Msg.alert('温馨提示', action.result.message);
            },
            failure: function (form, action) {
                Ext.Msg.alert('温馨提示', action.result.message);
            },
            scope: this
        });
    },

    //模板下载
    onTemplateDownload: function (button, e, eOpts) {
        var mImportForm = Ext.getCmp('importForm').getForm();
        mImportForm.submit({
            url: '/Download/StoreDetailDownloadTemplate',
            success: function (form, action) {
            },
            failure: function (form, action) {
            },
            scope: this
        });
    },

 

posted @ 2013-01-25 15:59  xust  阅读(194)  评论(0)    收藏  举报