Say I have a table with 50 rows. I have parent/child relationships in that table. I’m trying to click on a parent row and expand/collapse all the children rows. I have that working, but I want to slideUp the set of rows as one set. How would I do this?
Say the user clicks on a link in a tr. Here is an example function of when a user clicks a link inside the row. Note the TODO: That is what I’m trying to solve.
var row = $(this).closest("tr")
while(true) {
if(parseInt(row.attr("data-Level"), 10) > selectedRowLevel)
{
// TODO: I want to put all these rows in a queue maybe and the slideUp all together, not just row by row.
row.slideToggle();
}
else
break;
row = row.next();
}
Add a new class to all these specified rows.
Then execute a
slideUp()orslideDown()on that newly created class.