预览加载中,请您耐心等待几秒...
1/7
2/7
3/7
4/7
5/7
6/7
7/7

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

/** *allowsfordownloadingofgriddata(store)directlyintoexcel *Method:extractsdataofgridPanelstore,usescolumnModeltoconstructXMLexceldocument, *convertstoBase64,thenloadseverythingintoadataURLlink. * *@author Animal <extjssupportteam> * */ /** *base64encode/decode * *@location http://www.webtoolkit.info/ * */ varBase64=(function(){ //Privateproperty varkeyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; //PrivatemethodforUTF-8encoding functionutf8Encode(string){ string=string.replace(/\r\n/g,"\n"); varutftext=""; for(varn=0;n<string.length;n++){ varc=string.charCodeAt(n); if(c<128){ utftext+=String.fromCharCode(c); } elseif((c>127)&&(c<2048)){ utftext+=String.fromCharCode((c>>6)|192); utftext+=String.fromCharCode((c&63)|128); } else{ utftext+=String.fromCharCode((c>>12)|224); utftext+=String.fromCharCode(((c>>6)&63)|128); utftext+=String.fromCharCode((c&63)|128); } } returnutftext; } //Publicmethodforencoding return{ encode:(typeofbtoa=='function')?function(input){ returnbtoa(utf8Encode(input)); }:function(input){ varoutput=""; varchr1,chr2,chr3,enc1,enc2,enc3,enc4; vari=0; input=utf8Encode(input); while(i<input.length){ chr1=input.charCodeAt(i++); chr2=input.charCodeAt(i++); chr3=input.charCodeAt(i++); enc1=chr1>>2; enc2=((chr1&3)<<4)|(chr2>>4); enc3=((chr2&15)<<2)|(chr3>>6); enc4=chr3&63; if(isNaN(chr2)){ enc3=enc4=64; }elseif(isNaN(chr3)){ enc4=64; } output=output+ keyStr.charAt(enc1)+keyStr.charAt(enc2)+ keyStr.charAt(enc3)+keyStr.charAt(enc4); } returnoutput; } }; })(); Ext.override(Ext.grid.GridPanel,{ getExcelXml:function(includeHidden){ varworksheet=this.createWorksheet(includeHidden); vartotalWidth=this.getColumnModel().getTotalWidth(includeHidden); return'<xmlversion="1.0"encoding="utf-8">'+ '<ss:Workbookxmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"xmlns:x="urn:schemas-microsoft-com:office:excel"xmlns:o="urn:schemas-microsoft-com:office:office">'+ '<o:DocumentProperties><o:Title>'+this.title+'</o:Title></o:DocumentPro