if you work with ID's you won't have choice but to use filters, however if you can associate a class  matching system when you construct the ID's   would simplify filtering

<tr id="top11_21"><td><a href="" id="top11_21click" class="class11_21">click here</a></
td>...rest of row data</td></tr>
<tr id="act11_21_1" class="class11_21"><td>...</td></tr>
<tr id="act11_21_2" class="class11_21"><td>...</td></tr>
$("td").click(function () {

    className= $(this).attr("class");
    $(this).nextAll(className).show();
});


pantagruel wrote:
Hi,

I have a situation where a user clicks on something in a particular
table row which should cause all following rows in that table that
have a particular format of id to toggle visibility.. so for example

<tr id="top11_21"><td><a href="" id="top11_21click">click here</a></
td>...rest of row data</td></tr>
<tr id="act11_21_1"><td>...</td></tr>
<tr id="act11_21_2"><td>...</td></tr>
................
<tr id="act11_21_30"><td>...</td></tr>
<tr id="top11_22"><td><a href="" id="top11_22click">click here</a></
td>...rest of row data</td></tr>

when someone clicks on top11_21click it should toggle the visibility
of rows act11_21_1 to act11_21_30
I would like to have this efficient, thus not just a find or filter,
but rather something that gets the context of the clicked row and then
loops following rows until the input does not match - any suggestions
for a jquery like way of handling this?

  

Reply via email to