There is a function that returns an array from a table:
GetFilteredData: function()
/*====================================================
- returns an array containing filtered data:
[rowindex,[value1,value2,value3...]]
=====================================================*/
{
var row = this.tbl.rows;
var filteredData = [];
for(var i=0; i<this.validRowsIndex.length; i++)
{
var rowData, cellData;
rowData = [this.validRowsIndex[i],[]];
var cells = tf_Tag(row[this.validRowsIndex[i]],'td');
for(var j=0; j<cells.length; j++)
{
var cell_data = tf_GetNodeText(cells[j]);
rowData[1].push( cell_data );
}
filteredData.push(rowData);
}
return filteredData;
},
I use this code to get the data to a CSV and save it straight to desktop:
<script language="JavaScript">
function WriteToFile()
{
var fso, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.OpenTextFile("exported.csv" , 2, 1, -2);
var colvals = tf_table1.GetFilteredData(true);
for (i=0; i<colvals.length; i++){
s.write(colvals[i] + '\r\n');
}
s.Close();
}
It works fine, however IE security settings need to be set to Minimum (Internet Options -> Security). Is there any way to rewrite this code so that they would work on Medium (Default) Settings?
Thanks!