日期:2014-05-17 浏览次数:20656 次
xtype : 'button',
iconCls : 'icon-nav',
width : 50,
id:'exportBtn',
disabled:true,
text : '导出Excel',
handler : function() {
var vExportContent = grid.getExcelXml();
if (Ext.isIE6 || Ext.isIE7 || Ext.isIE8 || Ext.isSafari || Ext.isSafari2 || Ext.isSafari3) {
var fd=Ext.get('frmDummy');
if (!fd) {
fd=Ext.DomHelper.append(Ext.getBody(),{tag:'form',method:'post',id:'frmDummy',
action:'../../jsp/item/exportExcel.jsp', target:'_blank',
name:'frmDummy',cls:'x-hidden',cn:[
// {tag:'input',name:'fileName',id:'fileName',type:'hidden'},
{tag:'input',name:'exportContent',id:'exportContent',type:'hidden'}
]},true);
}
// fd.child('#fileName').set({value:vExportContent});
fd.child('#exportContent').set({value:vExportContent});
fd.dom.submit();
} else {
document.location = 'data:application/vnd.ms-excel;base64,'+Base64.encode(vExportContent);