How to export an excel file via easyui without a pop-up download box
The code used in ajax is as follows (ActionUrl is the path of ashx of the general processing program ):
$. Ajax ({url: ActionUrl + '? Action = export & ID = '+ $ (' # fm_ID '). val (), dataType: 'json', success: function (jsonstr) {// top. art. dialog. tips ('export successful! ');}});
The download box cannot be displayed.
Enter the relevant page address in the address bar of the browser and open it to bring up the download box for download. This may be because of iframe.
Because you can open the download box by entering the page address, you may consider opening a new page for download. However, because NPOI is used for export, you need to pass the DataTable, so this is not the case.
To use window. showModalDialog:
Window. showModalDialog (ActionUrl + '? Action = export & ID = '+ $ (' # fm_ID '). val ());
However, only one blank form is displayed and will not be downloaded.
Finally, use window. open to implement:
Window. open (ActionUrl + '? Action = export & ID = '+ $ (' # fm_ID '). val ());