By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

How to display dynamically growing table?

P: 110
hi all,

I have a content which is fetched from a JSON response. I am putting that in a dynamic table and showing the data. The problem with this approach is, I am adding row by row and finally appending that to a table, so if result set is large then browser struggles a lot to display and takes some time to display whole result in one shot. Instead of this if we can display the table as a growing table with rows displayed as and when rows become available.

Expand|Select|Wrap|Line Numbers
  1. http = new yXMLHttpRequest();
  2. http.onreadystatechange = function()
  3. {
  4.      if(http.readyState == 4 && http.status == 20)
  5.      {
  6.           // Table populated here
  7.      }
  8. } // Table is not displayed until control comes out of here..
  10. .
  11. .
  12. .
  13. http.send()
I am using IE 6 and asynchronous request.
any ideas? Please help

waiting for your reply,
May 27 '08 #1
Share this Question
Share on Google+
4 Replies

Expert 100+
P: 1,654
Use insertRow and insertCell instead of appendChild.
May 27 '08 #2

P: 110
Thanks for your quick reply, ok i will check this out.

May 27 '08 #3

P: 110
I tried with the above approach.. it is simple but i still have the same problem..once data is given to browser browser goes into a not_responding state..
My question is
1) When will the browser actually display the data? As soon as we do appendChild?

waiting 4 u r rep,
May 30 '08 #4

Expert 100+
P: 1,654
Can you please show me the part of the code where you're creating your dynamic table?

And browser will of course show data as soon as you do append child. But if data is too much(too many rows), then there's a response time. That's why I told you to use insertRow so that each row can be displayed as soon as its inserted instead of waiting for the whole table to get filled first.
May 30 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.