Hi,
I have a table (created by a GridView in C#.Net - but I don't think that's important)
The table created ends up looking like this:
Basically, TableGroup1 are the category rows, TableGroup2 the sub categories and TableGroup3 the details.
I want to collapse the table to only show the category (TableGroup1) rows, until one of them is clicked when it should show the 'child' TableGroup2 and TableGroup3 rows.
I've attempted this already in jQuery:
but that toggles all of the TableGroup2 & 3 rows, rather than just the ones under the clicked category.
Can you help?
Cheers!
I have a table (created by a GridView in C#.Net - but I don't think that's important)
The table created ends up looking like this:
Code:
<tr class="TableGroup1"></tr>
<tr class="TableGroup2"></tr>
<tr class="TableGroup3"></tr>
<tr class="TableGroup3"></tr>
<tr class="TableGroup3"></tr>
<tr class="TableGroup1"></tr>
<tr class="TableGroup2"></tr>
<tr class="TableGroup3"></tr>
<tr class="TableGroup2"></tr>
<tr class="TableGroup3"></tr>
Basically, TableGroup1 are the category rows, TableGroup2 the sub categories and TableGroup3 the details.
I want to collapse the table to only show the category (TableGroup1) rows, until one of them is clicked when it should show the 'child' TableGroup2 and TableGroup3 rows.
I've attempted this already in jQuery:
Code:
$(document).ready(function() {
$(".TableGroup2").hide();
$(".TableGroup3").hide();
$(".TableGroup1").click(function() {
$(".TableGroup2").toggle();
$(".TableGroup3").toggle();
});
});
but that toggles all of the TableGroup2 & 3 rows, rather than just the ones under the clicked category.
Can you help?
Cheers!