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

Link to comment
Share on other sites

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++;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.