Extjs ajax form 提交

1.form 提交

 form.form.submit({
                    url: "/HandlerExcelToDB/UploadFile.ashx",
                    params: {},
                    success: function (formUpload, action) {
                        var PicName = action.result.FileName;

                        Ext.MessageBox.alert("提示", "上传成功!");
                        Ext.MessageBox.hide();
                        winUpload_Excel.hide();
                    },
                    failure: function (formUpload, action) {
                        Ext.MessageBox.alert("提示", "上传失败!");
                    }
                });

2.ajax 提交

  Ext.Ajax.request({
                        url: '/HandlerExcelToDB/PKUCarPart_ExcelToDB.ashx?Func=PKUCarPartExcelToDB',
                        method: 'POST',
                        params: {
                            ModelId: ModelId,
                            CPTrademarkId: CPTrademarkId,
                            ShopId: ShopId,
                            FileExcel:FileExcel,
                            ProductMainPic: ProductMainPic,
                            JsonDatarCarPKU: Ext.encode(arrayCarPKU),
                        },
                        success: function (response) {
                            Ext.MessageBox.alert('提示', '保存成功!');
                            store.load({ params: { start: start, limit: limit } });
                            Ext.MessageBox.hide();
                            form.getForm().reset();
                            win.hide();
                        },
                        failure: function () {
                            Ext.MessageBox.alert("提示", "保存失败!");
                        }
                    });

 

posted @ 2016-03-02 10:23  秋风过、枯叶落  阅读(777)  评论(0编辑  收藏  举报