• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Dynamically created table does not display correctly on reload

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am dynamically creating a table using JavaScript/jQuery/html from an Ajax call. The first time the table loads it displays correctly formatted. However, when I do a refresh/reload the formatting of the table is not correct. Please refer to attached images. I have included Promise to try and fix it as per https://www.taniarascia.com/how-to-promisify-an-ajax-call/

The abbreviated code is:

Capture3.PNG
Correctly formatted table
Correctly formatted table
Capture4.PNG
Incorrectly formatted table after reload
Incorrectly formatted table after reload
 
Glyndwr Bartlett
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Including my HTML:

 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the debugging inspector to see how the DOM elements differ from when they are the expected, to when they are wrong. That should give you a thread to pull to figure out what's awry.
 
Glyndwr Bartlett
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer is to move the population of the first column to where I do the input lines.

 
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic