I currently have a table with a nested table in it:
<table class="datagrid" id="report">
<thead>
<tr>
<th>item1</th>
<th>item2</th>
</tr>
</thead>
<tbody>
<tr class="odd"> <-- on click from this level only
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">
<table>
<tr class="odd"> <-- not to be fired here
<td></td>
etc table structure.
I am currently using the following jQuery, which fires on every tr
regardless of the table level. How do I change it to only fire on the first level?
$(document).ready(function(){
$("#report tr:not(.odd)").hide();
$("#report tr:first-child").show();
$("#report tr.odd").click(function(){
$(this).next("#report tr").fadeToggle(600);
});
});