fourfire 发表于 2013-1-23 02:48:33

extjs点击按钮下载

原理是生成一个隐藏的form,提交给它
{
id : 'buttonA',
text : "导出",
iconCls: 'export-icon',
handler : function() {
if (!Ext.fly('test')) {
      var frm = document.createElement('form');
      frm.id = 'test';
      frm.name = id;
      frm.style.display = 'none';
      document.body.appendChild(frm);
       }
       Ext.Ajax.request({
      url: 'download.do',
      form: Ext.fly('test'),
      method: 'POST',
      
      isUpload: true
       });

}

}
页: [1]
查看完整版本: extjs点击按钮下载