Well, that ExternalInterface performs really poorly with moderate-sized
data sets is a known issue:
http://codinginparadise.org/weblog/2006/02/how-to-speed-up-flash-8s.html


-- 
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com

-----Original Message-----
From: Dominic Pazula <[EMAIL PROTECTED]>
Reply-To: flexcoders@yahoogroups.com
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DataGrid and exporting values
Date: Thu, 01 May 2008 18:54:02 -0000

Like a lot of people, I've been wanting to export values out of a 
data grid and into a file. I decided that I didn't want to go with 
the round trip to the server.

Instead, I use the ExternalInterface to call a js function that opens 
a new window and writes the values into a HTML table (uses js and the 
DOM). I have a "copy all" button that selects the table and copies 
it to the clip board. The user has to just then open Excel and 
hit "paste."

Slick, or so I thought.

I'm having performance issues -- any table of decent size takes 
forever to write to the window. 

The js that is doing the heavy lifting is:
for (i=0; i < data.length; i++){
j = 0;
var newRow = winTable.insertRow(-1);
for (j; j < data[i].length; j++){
var newCell = newRow.insertCell(j);
var newText = win.document.createTextNode(data[i][j]);
newCell.appendChild(newText);
}
}

Does anyone have suggestions on what I can do to speed this up?

Thanks
Dominic

PS Once I have this in decent working order, I will be happy post all 
the code.




 


Reply via email to