How to export an excel file via easyui without a pop-up download box

Source: Internet
Author: User

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 ());


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.