---
title: "extjs点击按钮下载"
author: "fourfire"
date: "2009-03-20T12:23:56Z"
tags: []
slug: "extjs"
draft: false
lastmod: "2009-03-20T12:23:56Z"
id: 352139
url: "https://fourfire.iteye.com/blog/352139"
---

原理是生成一个隐藏的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
											       });
										
										}

									}