/**
* allows for downloading of grid data (store) directly into excel
* Method: extracts data of gridPanel store, uses columnModel to construct XML excel document,
* converts to Base64, then loads everything into a data URL link.
*
* ***@author Animal <extjs support team>
*
*/
/**
* base64 encode / decode
*
* ***@location o/
*
*/
var Base64 = (function() {
// Private property
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// Private method for UTF-8 encoding
function utf8Encode(string) {
string = (/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < ; n++) {
var c = (n);
if (c < 128) {
utftext += (c);
}
else if((c > 127) && (c < 2048)) {
utftext += ((c >> 6) | 192);
utftext += ((c & 63) | 128);
}
else {
utftext += ((c >> 12) | 224);
utftext += (((c >> 6) & 63) | 128);
utftext += ((c & 63) | 128);
}
}
return utftext;
}
// Public method for encoding
return {
encode : (typeof btoa == 'function') ? function(input) {
return btoa(utf8Encode(input));
} : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = utf8Encode(input);
while (i < ) {
chr1 = inp
Extjs前台导出数据 来自淘豆网m.daumloan.com转载请标明出处.