EasyUI Forum
May 04, 2024, 01:05:15 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to use dialog to download the excel ?  (Read 3477 times)
cdtuql
Newbie
*
Posts: 26


View Profile Email
« on: April 10, 2017, 09:59:19 PM »

        var d= $("<div />").dialog({
           width:600,
           height:300,
           modal:true,
           href:'${pageContext.request.contextPath}/fuelnozzleFlowrecorder/getExcel',
           title:'下载Excel',
           method:'GET',
           queryParams:data,
           buttons:[
               {text:'保存',iconCls:'icon-save',plain:true,handler:function(){
                $('#BaseInfo_gasdispensereditform_form').form('submit', {
            url:'${pageContext.request.contextPath}/gasdispenser/addGasdispenser',
            success : function(r) {
                     var obj = jQuery.parseJSON(r);                     
                     if (obj.success) {
                        d.dialog('close');                        
                        $('#BaseInfo_Gasdispenser_datagrid').datagrid('insertRow',{
                           index:0,
                           row:obj.obj
                        });
                        
                     }
                     $.messager.show({
                        title : '提示',
                        msg : obj.msg
                     });
                  }
               });
   
       
           }},{text:'取消',iconCls:'icon-cancel',plain:true,handler:function(){
                       d.dialog('close');}}],
    onClose:function(){
       $(this).dialog('destroy');
    }
   
    });   
       
  I use the  above code that use the dialog  to download the xls produced by the server ,I get the content that can no't read,did not download the xls file, but the  window.location.href can download the file,because I will send  a lot parameter to server,I do not use window.location.href to donwload the xls file ,how can i do
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!