File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weird issue while populating a table using jquery

 
Naveen puttu
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Code in my jsp




This is a snippet of my JS file



This is how im calling my js function



The issue that iam facing right now is that the click event renders the data in the table ; as in the <tboby> has the data populated , however the change event doesnt ; as in the <tboby> is empty

What am i missing ??

Cheers
n4v33n
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to append the rows to the table's tbody, not the table

Eric
 
Naveen puttu
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anything is fine eric

but why isnt the data showing up
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
table.append

That is appending it to the table and not the tbody


should be



Also are you sure it is getting the data and creating the rows? Have you used a tool such as Fiddler to add break points and see what is happening?

Eric
 
Naveen puttu
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eric


im using firebug debug functionality and i can see the data . its only that the data isnt getting set in the table
 
Naveen puttu
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eric


iam using firebug debug functionality and i can see the data . its only that the data isnt getting set in the table

BTW your suggestion did not work ERIC . its so frustrating man
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you actually seeing it going into the each loop?
 
Naveen puttu
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Eric,

I fixed this issue mate

while i was doing this



i wasnt emptying the $("#questionWeightsTableContainer") . So there were two tables with the same id and that was the culprit

i was so stupid . took me a really long time to realise

Thanks for the inputs mate

Cheers
n4v33n

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic