Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Pushing out html as and when ready (table)

 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have an app which returns a DOM back as an AJAX response. I loop through the result and populate the results in a table by dynamically inserting rows in the table.

My Issue is the browser becomes unresponsive and waits for the loop to complete and once all the records are inserted, only then it shows all records. Its not a very major hit .. but is there any way i can make the rows visible as and when one iteration of the javascrpt loop is completed. i.e one row in inserted in the table.?

here is the manner in which the rows are inserted. (not actual code just logic)

for all the records
insertRow in the table tbody
insertCell in the rows
end for..
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look into making a loop with setTimeout. It will not freeze the browser.

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic