Skip to content

Commit 3edfdf2

Browse files
waiterZenar2rsawseen
authored andcommitted
[core] fix data table export bug
1 parent 86fdabe commit 3edfdf2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

frontend/express/public/javascripts/countly/countly.helpers.js

+16
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,22 @@
305305
tableData = app.dataExports[tableCols[0].sExport]();
306306
}
307307
else{
308+
// TableTools deprecated by offical,
309+
// fix bug with workaround for export table
310+
TableTools.fnGetInstance = function ( node ) {
311+
if ( typeof node != 'object' ) {
312+
node = document.getElementById(node);
313+
}
314+
var iLen=TableTools._aInstances.length;
315+
if(iLen > 0){
316+
for ( var i = iLen - 1 ; i >= 0 ; i-- ) {
317+
if ( TableTools._aInstances[i].s.master && TableTools._aInstances[i].dom.table == node ) {
318+
return TableTools._aInstances[i];
319+
}
320+
}
321+
}
322+
return null;
323+
};
308324
tableData = TableTools.fnGetInstance(dtable[0]).fnGetTableData({"sAction":"data","sTag":"default","sLinerTag":"default","sButtonClass":"DTTT_button_xls","sButtonText":"Save for Excel","sTitle":"","sToolTip":"","sCharSet":"utf16le","bBomInc":true,"sFileName":"*.csv","sFieldBoundary":"","sFieldSeperator":"\t","sNewLine":"auto","mColumns":"all","bHeader":true,"bFooter":true,"bOpenRows":false,"bSelectedOnly":false,"fnMouseover":null,"fnMouseout":null,"fnSelect":null,"fnComplete":null,"fnInit":null,"fnCellRender":null,"sExtends":"xls"});
309325
tableData = tableData.split(/\r\n|\r|\n/g);
310326
tableData.shift();

0 commit comments

Comments
 (0)