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