Al momento ho una tabella con una tabella nidificata in essa:jQuery seleziona solo tr/td nella tabella principale, non le tabelle nidificate.
<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>
ecc struttura della tabella.
Attualmente sto usando il seguente jQuery, che si attiva su ogni tr
indipendentemente dal livello della tabella. Come posso cambiarlo per sparare solo al primo livello?
$(document).ready(function(){
$("#report tr:not(.odd)").hide();
$("#report tr:first-child").show();
$("#report tr.odd").click(function(){
$(this).next("#report tr").fadeToggle(600);
});
});
Grazie per la pronta risposta. Io nuovo era qualcosa di veramente semplice. – TheAlbear