Here's the first thing I notice:
Code:
$("#report div.arrow.odd").click(function(){
That selector is incorrect. Jquery uses the same selector "chain" as CSS. So, since div.arrow.odd wouldn't work in CSS, it won't work in jquery. Think about it like this: if you wanted to
style all of the arrow divs in that table, how would you do it? Perhaps something like:
Or, more specific:
Code:
#report tr td div.arrow
Or, since the clickable rows are all classed as odd, use the original with one "extension":
Code:
#report tr.odd div.arrow
Just like CSS, the level of specificity required depends upon the rest of the structure.
I think parent()/parents() is needed because you need to move back up the DOM structure to the tr that is the
parent of the clicked div.arrow. Once you've done that, then you can use the next() call that's in the original which opens the next tr. I'm probably wrong, but it may be something like this:
Code:
$(this).parents('#report tr.odd').next("tr").toggle();
The last half is reproduced from the original. The first half attempts to identify the parent tr of the div.arrow. Make sense?