www-thermferm/jqwidgets/jqxdata.export.js

Sat, 29 Nov 2014 21:03:31 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 29 Nov 2014 21:03:31 +0100
changeset 301
dbaed96a4a0c
parent 117
7119ea8a5225
child 336
217f330b05cb
permissions
-rw-r--r--

Upgraded jqwidgets to version 3.6.0

/*
jQWidgets v3.6.0 (2014-Nov-25)
Copyright (c) 2011-2014 jQWidgets.
License: http://jqwidgets.com/license/
*/

(function(b){var a=(function(){var c={},u,q,j,l,g,h,o,p;function d(B,A,x,z,y,v,w){this.hierarchy=y;this.exportFormat=v;this.filename=w;B.beginFile(w);n(B);k(B);B.endFile(w);return B.getFile()}function n(z){var x=true;b.each(q,function(){if(this.hidden){x=false;return false}});z.beginHeader(x);var w=0;for(var v in q){if(q[v].columnsDataFields){v=q[v].columnsDataFields[w].displayfield}var y=m(v,q[v]);z.appendHeaderCell(q[v],v,y,x,w);w++}z.endHeader(x)}function k(x){x.beginBody();if(this.hierarchy){var w=function(z){for(var y=0;y<z.length;y+=1){if(z[y]!==undefined){x.beginRow(z[y].level);e(x,z[y],y,true);if(z[y].records){x.beginRows(z[y].level);w(z[y].records);x.endRows(z[y].level)}x.endRow(z[y].level)}}};w(u);x.endBody();return}for(var v=0;v<u.length;v+=1){if(u[v]!==undefined){e(x,u[v],v)}}x.endBody()}function e(A,z,B,v){var x;if(v!=true){A.beginRow()}var y=0;for(var w in q){if(q[w].columnsDataFields){w=q[w].columnsDataFields[y].displayfield}x=s(B,w);if(x){if(x.level!=undefined){if(x.index-1>z.level&&x.index-1<x.maxLevel){y++;continue}}if(x.maxLevel!=undefined){if(x.index-1==x.maxLevel){x=b.extend({},x);x.merge=x.maxLevel-z.level-1}}}if(z.level!=undefined&&z.label!=undefined){if(this.exportFormat==="xml"||this.exportFormat==="json"){var C={};C.text="group";A.appendBodyCell(z.label,C,x,z,y,"group");break}}if(z.hasOwnProperty(w)){A.appendBodyCell(z[w],q[w],x,z,y)}else{A.appendBodyCell("",q[w],x,z,y)}y++}if(v!=true){A.endRow()}}function m(w,x){if(x.style){return j[x.style]}var v=t();if(v.length>0){return v[0].style}return null}function t(){if(!g){g=new Array();b.each(j,function(v,w){g[g.length]={name:v,style:w}})}return g}function s(A,z){var B=q[z];if(B){if(B.customCellStyles){var x=B.customCellStyles[A];if(x){return j[x]}}if(B.cellStyle){if(B.cellAltStyle){var w=A%2;if(w==0){return j[B.cellStyle]}return j[B.cellAltStyle]}return j[B.cellStyle]}else{var v=t();if(v.length>0){var w=A%(v.length-1);var y=v[w+1].style;return y}}}return null}function r(y,w,x){var v=document.createElement("input");v.name=w;v.value=y;v.type="hidden";x.appendChild(v);return v}function f(x,v,w){var y=document.createElement("textarea");y.name=v;y.value=x;w.appendChild(y);return y}function i(w,z,y,v,A){var x=document.createElement("form");r(w,"filename",x);r(z,"format",x);f(y,"content",x);if(v==undefined||v==""){if(window&&window.location.toString().indexOf("jqwidgets.com")>=0){v="http://jqwidgets.com/export_server/save-file.php"}else{v="http://jquerygrid.net/export_server/save-file.php"}}x.action=v;x.method="post";if(A){x.acceptCharset=A}document.body.appendChild(x);return x}l=function(A,y,x,w,z,v){if(!(this instanceof a)){return new a(A,y,x,z,v)}u=A;q=y;j=x;this.exportTo=function(F,D,B,C){F=F.toString().toLowerCase();var E=c[F];if(typeof E==="undefined"){throw"You can't export to "+F+" format."}return d(E,u,q,j,D,B,C)};this.exportToFile=function(G,C,B,H,D){var F=this.exportTo(G,D,G,C),E=i(C,G,F,B,H);E.submit();document.body.removeChild(E)};this.exportToLocalFile=function(F,C,D,B){var E=this.exportTo(F,D,B);document.location.href="data:application/octet-stream;filename="+C+","+encodeURIComponent(E)}};l.extend=function(v,w){if(w instanceof b.jqx.dataAdapter.DataExportModuleBase){c[v]=w}else{throw"The module "+v+" is not instance of DataExportModuleBase."}};return l}());b.jqx.dataAdapter.ArrayExporter=a})(jqxBaseFramework);(function(b){var a=function(){this.formatData=function(f,e,c,h){if(e==="date"){var d="";if(typeof f==="string"){d=b.jqx.dataFormat.tryparsedate(f);f=d}if(f===""||f===null){return""}d=b.jqx.dataFormat.formatdate(f,c,h);if(d.toString()=="NaN"||d==null){return""}f=d}else{if(e==="number"||e==="float"||e==="int"||e=="integer"){if(f===""||f===null){return""}if(!isNaN(new Number(f))){var g=b.jqx.dataFormat.formatnumber(f,c,h);if(g.toString()=="NaN"){return""}else{f=g}}}else{f=f}}if(f===null){return""}return f};this.getFormat=function(f){var c=f?f.formatString:"";var e=f?f.localization:"";var d="string";d=f?f.type:"string";if(d=="number"||d=="float"){if(!c){c="f2"}}if(d=="int"||d=="integer"){if(!c){c="n0"}}if(d=="date"){if(!c){c="d"}}return{type:d,formatString:c,localization:e}};this.beginFile=function(){throw"Not implemented!"};this.beginHeader=function(){throw"Not implemented!"};this.appendHeaderCell=function(){throw"Not implemented!"};this.endHeader=function(){throw"Not implemented!"};this.beginBody=function(){throw"Not implemented!"};this.beginRow=function(){throw"Not implemented!"};this.beginRows=function(){throw"Not implemented!"};this.endRows=function(){throw"Not implemented!"};this.appendBodyCell=function(){throw"Not implemented!"};this.endRow=function(){throw"Not implemented!"};this.endBody=function(){throw"Not implemented!"};this.endFile=function(){throw"Not implemented!"};this.getFile=function(){throw"Not implemented!"}};b.jqx.dataAdapter.DataExportModuleBase=a})(jqxBaseFramework);(function(d){var c=function(j){var e,h,g;var l=0;var i=this;this.beginFile=function(){e=""};this.beginHeader=function(){};this.appendHeaderCell=function(q,r,p,m,n){if(p){if(p.level!=undefined){if(n<p.maxLevel){return}else{if(n===p.maxLevel){if(m){k(q.text)}for(var o=0;o<p.maxLevel;o++){k("")}return}}}}g=m;if(m){k(q.text)}};this.endHeader=function(){this.endRow()};this.beginBody=function(){l=0};this.beginRow=function(){if((l>0)||(l==0&&g)){e+="\n"}l++};this.appendBodyCell=function(q,m,p,r,n){if(p){if(p.maxLevel!=undefined){if(n===p.maxLevel){k(q,m);for(var o=0;o<p.maxLevel-r.level-1;o++){k("",m)}return}}}k(q,m)};this.endRow=function(){e=e.substring(0,e.length-1)};this.endBody=function(){};this.endFile=function(){};this.getFile=function(){return e};function f(m,o){if(o){var n=i.getFormat(o);m=i.formatData(m,n.type,n.formatString,n.localization)}m='"'+m+'"';return m}function k(m,n){m=f(m,n);e+=m+j}};c.prototype=new d.jqx.dataAdapter.DataExportModuleBase();var a=function(){};a.prototype=new c(",");var b=function(){};b.prototype=new c("\t");d.jqx.dataAdapter.ArrayExporter.extend("csv",new a());d.jqx.dataAdapter.ArrayExporter.extend("tsv",new b())})(jqxBaseFramework);(function(d){var a=function(){var i=false;var g;var h;var j=0;this.setPDF=function(){i=true};this.beginFile=function(k){if(i||k==undefined){g='<table style="empty-cells: show;" cellspacing="0" cellpadding="2">'}else{g='<html>\n\t<head>\n\t\t<title></title>\n\t\t<meta http-equiv=Content-type content="text/html; charset=UTF-8">\n\t</head>\n\t<body>\n\t\t<table style="empty-cells: show;" cellspacing="0" cellpadding="2">'}};this.beginHeader=function(){if(i){g+="\n\t<thead><tr>"}else{g+="\n\t\t\t<thead>"}};this.appendHeaderCell=function(m,n,l,k){h=k;if(!k){return}if(i){g+='\n\t\t\t\t<th style="'+f(l)+'">'+m.text+"</th>"}else{if(l.disabled){return}if(l.merge){if(m.width){g+="\n\t\t\t\t<th colspan="+(1+l.merge)+' style="width: '+m.width+"px; "+f(l)+'">'+m.text+"</th>"}else{g+="\n\t\t\t\t<th colspan="+(1+l.merge)+' style="'+f(l)+'">'+m.text+"</th>"}}else{if(m.width){g+='\n\t\t\t\t<th style="width: '+m.width+"px; "+f(l)+'">'+m.text+"</th>"}else{g+='\n\t\t\t\t<th style="'+f(l)+'">'+m.text+"</th>"}}}};this.endHeader=function(){if(i){g+="\n\t</tr></thead>"}else{g+="\n\t\t\t</thead>"}};this.beginBody=function(){if(i){g+="\n\t<tbody>"}else{g+="\n\t\t\t<tbody>"}j=0};this.beginRow=function(){if(i){g+="\n\t<tr>"}else{g+="\n\t\t\t\t<tr>"}j++};this.appendBodyCell=function(l,n,k){var m=this.getFormat(n);if(l===""){l="&nbsp;"}if(i){if(j==1&&!h){g+='\n\t\t\t\t\t<td style="'+f(k)+' border-top-width: 1px;">'+this.formatData(l,m.type,m.formatString,m.localization)+"</td>"}else{g+='\n\t\t\t\t\t<td style="'+f(k)+'">'+this.formatData(l,m.type,m.formatString,m.localization)+"</td>"}}else{if(k.merge){if(j==1&&!h){g+="\n\t\t\t\t\t<td colspan="+(1+k.merge)+' style="'+f(k)+' border-top-width: 1px;">'+this.formatData(l,m.type,m.formatString,m.localization)+"</td>"}else{g+="\n\t\t\t\t\t<td colspan="+(1+k.merge)+' style="'+f(k)+'">'+this.formatData(l,m.type,m.formatString,m.localization)+"</td>"}}else{if(j==1&&!h){g+='\n\t\t\t\t\t<td style="'+f(k)+' border-top-width: 1px;">'+this.formatData(l,m.type,m.formatString,m.localization)+"</td>"}else{g+='\n\t\t\t\t\t<td style="'+f(k)+'">'+this.formatData(l,m.type,m.formatString,m.localization)+"</td>"}}}};this.endRow=function(){if(i){g+="\n\t</tr>"}else{g+="\n\t\t\t\t</tr>"}};this.endBody=function(){if(i){g+="\n\t</tbody>"}else{g+="\n\t\t\t</tbody>"}};this.endFile=function(k){if(i||k==undefined){g+="\n</table>"}else{g+="\n\t\t</table>\n\t</body>\n</html>\n"}};this.getFile=function(){return g};function f(m){var k="";for(var l in m){if(m.hasOwnProperty(l)){if(i&&l=="font-size"){m[l]="100%"}k+=l+":"+m[l]+";"}}return k}};a.prototype=new d.jqx.dataAdapter.DataExportModuleBase();var e=function(){};e.prototype=new a();var c=function(){};c.prototype=new a();var b=new c();b.setPDF();d.jqx.dataAdapter.ArrayExporter.extend("html",new e());d.jqx.dataAdapter.ArrayExporter.extend("pdf",b)})(jqxBaseFramework);(function(b){var a=function(){var h,l,d,i,c,j,m={style:"",stylesMap:{font:{color:"Color","font-family":"FontName","font-style":"Italic","font-weight":"Bold"},interior:{"background-color":"Color",background:"Color"},alignment:{left:"Left",center:"Center",right:"Right"}},startStyle:function(p){this.style+='\n\t\t<Style ss:ID="'+p+'" ss:Name="'+p+'">'},buildAlignment:function(q){if(q["text-align"]){var r=this.stylesMap.alignment[q["text-align"]];if(!r){r="Left"}var p='\n\t\t\t<Alignment ss:Vertical="Bottom" ss:Horizontal="'+r+'"/>';this.style+=p}},buildBorder:function(s){if(s["border-color"]){var r="\n\t\t\t<Borders>";var u='\n\t\t\t\t<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="'+s["border-color"]+'"/>';var p='\n\t\t\t\t<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="'+s["border-color"]+'"/>';var q='\n\t\t\t\t<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="'+s["border-color"]+'"/>';var t='\n\t\t\t\t<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="'+s["border-color"]+'"/>';r+=u;r+=p;r+=q;r+=t;r+="\n\t\t\t</Borders>";this.style+=r}},buildFont:function(q){var r=this.stylesMap.font,p="\n\t\t\t<Font ";for(var s in r){if(typeof q[s]!=="undefined"){if(s==="font-style"&&q[s].toString().toLowerCase()==="italic"){p+='ss:Italic="1" '}else{if(s==="font-weight"&&q[s].toString().toLowerCase()==="bold"){p+='ss:Bold="1" '}else{if(s==="color"){p+="ss:"+r[s]+'="'+q[s]+'" '}}}}}p+="/>";this.style+=p},buildInterior:function(q){var r=this.stylesMap.interior,t="\n\t\t\t<Interior ";var p=false;for(var s in r){if(typeof q[s]!=="undefined"){t+="ss:"+r[s]+'="'+q[s]+'" ';p=true}}if(p){t+='ss:Pattern="Solid"'}t+="/>";this.style+=t},buildFormat:function(q){if(q.dataType=="number"||q.dataType=="float"||q.dataType=="int"||q.dataType=="integer"){var p=q.formatString;if(p==""||p.indexOf("n")!=-1||p.indexOf("N")!=-1){this.style+='\n\t\t\t<NumberFormat ss:Format="0"/>'}else{if(p=="f"||p=="F"||p=="D"||p.indexOf("d")!=-1){this.style+='\n\t\t\t<NumberFormat ss:Format="#,##0.00_);[Red](#,##0.00)"/>'}else{if(p.indexOf("p")!=-1||p.indexOf("P")!=-1){this.style+='\n\t\t\t<NumberFormat ss:Format="Percent"/>'}else{if(p.indexOf("c")!=-1||p.indexOf("C")!=-1){if(parseInt(q.currencysymbol.charCodeAt(0))==8364){this.style+='\n\t\t\t<NumberFormat ss:Format="Euro Currency"/>'}else{this.style+='\n\t\t\t<NumberFormat ss:Format="Currency"/>'}}}}}}else{if(q.dataType=="date"){this.style+='\n\t\t\t<NumberFormat ss:Format="Short Date"/>'}}},closeStyle:function(){this.style+="\n\t\t</Style>"},toString:function(){var p=this.style;this.style="";return p}};this.beginFile=function(){c={};j=0;h='<?xml version="1.0"?>\n\t<?mso-application progid="Excel.Sheet"?> \n\t<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" \n\txmlns:o="urn:schemas-microsoft-com:office:office" \n\txmlns:x="urn:schemas-microsoft-com:office:excel" \n\txmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" \n\txmlns:html="http://www.w3.org/TR/REC-html40"> \n\t<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> \n\t<Version>12.00</Version> \n\t</DocumentProperties> \n\t<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> \n\t<WindowHeight>8130</WindowHeight> \n\t<WindowWidth>15135</WindowWidth> \n\t<WindowTopX>120</WindowTopX> \n\t<WindowTopY>45</WindowTopY> \n\t<ProtectStructure>False</ProtectStructure> \n\t<ProtectWindows>False</ProtectWindows> \n\t</ExcelWorkbook> \n\t<Styles>'};this.beginHeader=function(){l='\n\t<Worksheet ss:Name="Sheet1">\n\t\t<Table>';d=[];i=[]};this.appendHeaderCell=function(r,s,q){var p=r.width!=undefined?r.width:r.text.length*10;l+='\n\t\t\t<Column ss:Width="'+p+'"/>';d.push(r);i.push(q)};this.endHeader=function(p){if(p){this.beginRow();for(var q=0;q<d.length;q+=1){if(i[q].disabled){continue}g.call(this,d[q]["text"],null,i[q])}this.endRow()}};this.beginBody=function(){};this.beginRow=function(q){if(q!=undefined){l+="\n\t\t\t";for(var p=0;p<q;p++){l+="\t"}l+="<Row>";return}l+="\n\t\t\t<Row>"};this.beginRows=function(p){l+="\n\t\t\t\t<Rows>"};this.appendBodyCell=function(r,p,q,s){g.call(this,r,p,q,s)};this.endRow=function(q){if(q!=undefined){l+="\n\t\t\t";for(var p=0;p<q;p++){l+="\t"}l+="</Row>";return}l+="\n\t\t\t</Row>"};this.endRows=function(q){if(q!=undefined){l+="\n\t\t\t";for(var p=0;p<q;p++){l+="\t"}l+="</Rows>";return}};this.endBody=function(){l+="\n\t\t</Table>"};this.endFile=function(){l+="\n\t</Worksheet>\n</Workbook>";h+="\n\t</Styles>"};this.getFile=function(){return h+l};function g(s,v,r,u){var q="String";var t=this.getFormat(v);if(s!=null&&s.toString().substring(0,3)=="_AG"){s=s.toString().substring(2);q="String"}else{if(t.type=="date"){s=this.formatData(s,t.type,t.formatString,t.localization);if(s===null||s===""){s="";q="String"}}if(t.type=="string"){if(s===null||s===undefined){s=""}else{if(s.toString().indexOf("&")>=0){s=s.toString().replace(/&/g,"&amp;")}if(s.toString().indexOf(">")>=0){s=s.toString().replace(/>/g,"&gt;")}if(s.toString().indexOf("<")>=0){s=s.toString().replace(/</g,"&lt;")}if(s.toString().indexOf('"')>=0){s=s.toString().replace(/"/g,"&quot;")}if(s.toString().indexOf("'")>=0){s=s.toString().replace(/'/g,"&apos;")}}}if(r.dataType=="number"||r.dataType=="float"||r.dataType=="int"||r.dataType=="integer"){q="Number";s=parseFloat(s);if(s===null||isNaN(s)||s===""){s="";q="String"}if(s&&q!="String"&&s!=""){if(v&&v.formatString&&v.formatString.indexOf("p")>=0){s=s/100}}r.currencysymbol=v.localization.currencysymbol}}var p=f(r);if(r.merge){l+='\n\t\t\t\t<Cell ss:MergeAcross="'+r.merge+'" ss:StyleID="'+p+'"><Data ss:Type="'+q+'">'+s+"</Data></Cell>"}else{l+='\n\t\t\t\t<Cell ss:StyleID="'+p+'"><Data ss:Type="'+q+'">'+s+"</Data></Cell>"}}function n(){j+=1;return"xls-style-"+j}function k(q){for(var p in c){if(o(q,c[p])&&o(c[p],q)){return p}}return undefined}function o(t,q){var s=true;for(var r in t){if(t[r]!==q[r]){s=false}}return s}function e(q,p){m.startStyle(q);m.buildAlignment(p);m.buildBorder(p);m.buildFont(p);m.buildInterior(p);m.buildFormat(p);m.closeStyle();h+=m.toString()}function f(p){if(!p){return""}var q=k(p);if(typeof q==="undefined"){q=n();c[q]=p;e(q,p)}return q}};a.prototype=new b.jqx.dataAdapter.DataExportModuleBase();b.jqx.dataAdapter.ArrayExporter.extend("xls",new a())})(jqxBaseFramework);(function(b){var a=function(){var e,c,d;this.beginFile=function(){e='<?xml version="1.0" encoding="UTF-8" ?>';e+="\n<table>"};this.beginHeader=function(){c=[]};this.appendHeaderCell=function(f,g){c.push(g)};this.endHeader=function(){};this.beginBody=function(g,f){};this.beginRow=function(g){if(g!=undefined){if(this.hierarchy){e+="\n\t";for(var f=0;f<g;f++){e+="\t\t"}e+="<row>";d=0;return}}e+="\n\t<row>";d=0};this.beginRows=function(g){if(g!=undefined){e+="\n\t\t";for(var f=0;f<g;f++){e+="\t\t"}e+="<rows>";d=0;return}e+="\n\t\t<rows>"};this.appendBodyCell=function(j,n,g,m,h,l){var k=this.getFormat(n);j=this.formatData(j,k.type,k.formatString,k.localization);if(k.type=="string"){if(j.toString().indexOf("&")>=0){j=j.toString().replace(/&/g,"&amp;")}if(j.toString().indexOf(">")>=0){j=j.toString().replace(/>/g,"&gt;")}if(j.toString().indexOf("<")>=0){j=j.toString().replace(/</g,"&lt;")}if(j.toString().indexOf('"')>=0){j=j.toString().replace(/"/g,"&quot;")}if(j.toString().indexOf("'")>=0){j=j.toString().replace(/'/g,"&apos;")}}if(m.level!=undefined){if(this.hierarchy){e+="\n\t\t";for(var f=0;f<m.level;f++){e+="\t\t"}if(l===undefined){e+="<"+c[d]+">"+j+"</"+c[d]+">"}else{e+="<"+l+">"+j+"</"+l+">"}}else{if(l!=undefined){e+="\n\t\t<"+l+">"+j+"</"+l+">"}else{e+="\n\t\t<"+c[d]+">"+j+"</"+c[d]+">"}}}else{e+="\n\t\t<"+c[d]+">"+j+"</"+c[d]+">"}d++};this.endRow=function(g){if(g!=undefined){if(this.hierarchy){e+="\n\t";for(var f=0;f<g;f++){e+="\t\t"}e+="</row>";d=0;return}}e+="\n\t</row>";d=0};this.endRows=function(g){if(g!=undefined){e+="\n\t\t";for(var f=0;f<g;f++){e+="\t\t"}e+="</rows>";d=0;return}e+="\n\t\t</rows>"};this.endBody=function(){};this.endFile=function(){e+="\n</table>"};this.getFile=function(){return e}};a.prototype=new b.jqx.dataAdapter.DataExportModuleBase();b.jqx.dataAdapter.ArrayExporter.extend("xml",new a())})(jqxBaseFramework);(function(d){var j=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(n){return'"'+n.replace(j,function(o){var p=l[o];return typeof p==="string"?p:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"'}function b(o){return o<10?"0"+o:o}function e(o){var n;if(isFinite(o.valueOf())){n=o.getUTCFullYear()+"-"+b(o.getUTCMonth()+1)+"-"+b(o.getUTCDate())+"T"+b(o.getUTCHours())+":"+b(o.getUTCMinutes())+":"+b(o.getUTCSeconds())+'Z"'}else{n="null"}return n}function g(q){var n=q.length,o=[],p;for(p=0;p<n;p++){o.push(h(p,q)||"null")}return"["+o.join(",")+"]"}function m(q){var o=[],p,n;for(p in q){if(Object.prototype.hasOwnProperty.call(q,p)){n=h(p,q);if(n){o.push(a(p)+":"+n)}}}return"{"+o.join(",")+"}"}function i(n){switch(Object.prototype.toString.call(n)){case"[object Date]":return e(n);case"[object Array]":return g(n)}return m(n)}function k(o,n){switch(n){case"string":return a(o);case"number":case"float":case"integer":case"int":return isFinite(o)?o:"null";case"boolean":return o}return"null"}function h(o,n){var q=n[o],p=typeof q;if(q&&typeof q==="object"&&typeof q.toJSON==="function"){q=q.toJSON(o);p=typeof q}if(/(number|float|int|integer|string|boolean)/.test(p)||(!q&&p==="object")){return k(q,p)}else{return i(q)}}function f(n){if(window.JSON&&typeof window.JSON.stringify==="function"){return window.JSON.stringify(n)}return h("",{"":n})}var c=function(){var q=this;this.prepareData=function(t,v){if(v){var u=q.getFormat(v);t=q.formatData(t,u.type,u.formatString,u.localization)}return t};var n,p,r,o=[],s=0;this.beginFile=function(){p=[]};this.beginHeader=function(){};this.appendHeaderCell=function(t){};this.endHeader=function(){};this.beginBody=function(u,t){};this.beginRow=function(){if(hierarchy){o[s]={}}else{r={}}};this.beginRows=function(){o[s].rows=[];s++;o[s]={}};this.endRows=function(){s--};this.appendBodyCell=function(u,t){var v=this.prepareData(u,t);if(hierarchy){o[s][t.text]=v}else{r[t.text]=v}};this.endRow=function(){if(hierarchy){if(s==0){p.push(o[s])}else{o[s-1].rows.push(o[s])}}else{p.push(r)}};this.endBody=function(){};this.endFile=function(){n=f(p)};this.getFile=function(){return n}};c.prototype=new d.jqx.dataAdapter.DataExportModuleBase();d.jqx.dataAdapter.ArrayExporter.extend("json",new c())})(jqxBaseFramework);

mercurial