$("#btnExport").click(function () { if ($('#GroupType').val() != null && $('#GroupType2').val() != null) { toastr.warning("@Translate("不能同时选择两种组合方式")"); return; } $("#QueryPanel").showLoading(); DT.FormPost("@Url.Action("DataTableExcel")", [{ exportParameters: JSON.stringify({ ExtendParameters: GetQueryParamValue(), Columns:null, FileName: "@ViewBag.Title" + ".xlsx" }) }]); });这是导出下载excel方法,怎么改成成功导出下载excel时输出“1
时间: 2024-03-06 20:47:13 浏览: 9
你可以将代码修改为:
```
$("#btnExport").click(function () {
if ($('#GroupType').val() != null && $('#GroupType2').val() != null) {
toastr.warning("@Translate("不能同时选择两种组合方式")");
return;
}
$("#QueryPanel").showLoading();
DT.FormPost("@Url.Action("DataTableExcel")", [{
exportParameters: JSON.stringify({
ExtendParameters: GetQueryParamValue(),
Columns:null,
FileName: "@ViewBag.Title" + ".xlsx"
})
}], function () {
console.log("1");
});
});
```
这样,在导出成功后,控制台会输出 "1"。
相关问题
$("#btnExport").click(function () {if ($('#GroupType').val() != null && $('#GroupType2').val() != null){toastr.warning("@Translate("不能同时选择两种组合方式")");return;} 这是导出方法,怎么改成导出时输出“1”
你可以将代码修改为:
```
$("#btnExport").click(function () {
if ($('#GroupType').val() != null && $('#GroupType2').val() != null){
toastr.warning("@Translate("不能同时选择两种组合方式")");
return;
}
console.log("1");
});
```
这样,在导出时,控制台会输出 "1"。
$("#btnExport").click(function () { if ($('#GroupType').val() != null && $('#GroupType2').val() != null) { toastr.warning("@Translate("不能同时选择两种组合方式")"); return; } $("#QueryPanel").showLoading(); DT.FormPost("@Url.Action("DataTableExcel")", [{ exportParameters: JSON.stringify({ ExtendParameters: GetQueryParamValue(), Columns:null, FileName: "@ViewBag.Title" + ".xlsx" }) }]); });这是导出方法,怎么改成成功导出时输出“1”
你可以将代码修改为:
```
$("#btnExport").click(function () {
if ($('#GroupType').val() != null && $('#GroupType2').val() != null){
toastr.warning("@Translate("不能同时选择两种组合方式")");
return;
}
$("#QueryPanel").showLoading();
DT.FormPost("@Url.Action("DataTableExcel")", [{
exportParameters: JSON.stringify({
ExtendParameters: GetQueryParamValue(),
Columns:null,
FileName: "@ViewBag.Title" + ".xlsx"
})
}], function () {
console.log("1");
});
});
```
这样,在导出成功后,控制台会输出 "1"。
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)