This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Weird issue while populating a table using jquery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Weird issue while populating a table using jquery" Watch "Weird issue while populating a table using jquery" New topic
Author

Weird issue while populating a table using jquery

Naveen puttu
Ranch Hand

Joined: Sep 15, 2009
Posts: 88
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
You want to append the rows to the table's tbody, not the table

Eric
Naveen puttu
Ranch Hand

Joined: Sep 15, 2009
Posts: 88
anything is fine eric

but why isnt the data showing up
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Sep 15, 2009
Posts: 88
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

Joined: Sep 15, 2009
Posts: 88
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
Are you actually seeing it going into the each loop?
Naveen puttu
Ranch Hand

Joined: Sep 15, 2009
Posts: 88
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
 
subject: Weird issue while populating a table using jquery