Greetings gang,
New to the list here! I'm working on an AJAX implementation that queries
the server for data and displays it in a table (I know, big surprise!). I
get the data back fine, but it seems very slow creating the table. I've got
about 8 columns and about 5000 rows (I know, a lot... but the client wants
them all at once!).
I've tried several methods of creating the table, but it's still very slow.
What seems to be the fastest is creating a large array of strings, and then
assigning them to the innerhtml of the div with string.join. Thusly:
function placeData(data) {
var strings = new Array();
strings.push(getTableHead());
for (i = 0; i < data.length; i++) {
strings.push('<TR id="sub' + data[i].ID + '">');
strings.push(makeSubscriptionRow(data[i]));
strings.push('</TR>rn');
}
strings.push('</table>');
display = strings.join('');
g_activeDiv.innerHTML = display;
}
When I put alerts between the lines, that last line setting the HTML takes
about 10 seconds. I tried creating DOM objects, which was a lot slower and
just a single string, which was a little slower, but it's still over 10
seconds.
Is there a faster way to do this, or do I just need to convince the client
to go to a paging implementation?
-D. Israel
dan%40ebji.org">dan
ebji.org
http://www.customcodebydan.com
AIM: JudoDanIzz
.