Jump to content

[SOLVED] Hide a table row from one of its td's values


guyfromfl

Recommended Posts

I am trying to make it so you can click the checkbox at the top, and it will hide all rows where the data of the Status column is "Complete"

 

I am trying to decide the best way to do it, either check the data that is in the innerHtml, or like I have now, php determines what the value from the database is and adds class='complete' to the tr tag.

 

Any suggestions?

 

Here is the test table:

http://bli.servehttp.com/bli/knowledgebase/issueList.php

No need to make the code more complex than it need to be by having it read the content. I would go with your second option. If you can't modify the class in an effective manner you could also set an id for each row that is complete in a numerical sequence: c_1, c_2, c_3, etc;

 

Then when the user selects complete, just create a loop that sets the display property for each row. You would use a while loop such that the loop will exit when there are no more IDs that match

 

Ex:

var idx = 1;
while (document.gertElementById('c_'+idx))
{
    //set row object display property
    idx++;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.