Skip to main content

Bug Tracker

Side navigation

#5043 closed bug (invalid)

Opened August 13, 2009 08:04AM UTC

Closed August 18, 2009 12:42AM UTC

hiding table rows based on attributes hides ALL table rows instead

Reported by: machba Owned by:
Priority: major Milestone: 1.3.2
Component: selector Version: 1.3.2
Keywords: table row attributes hide show Cc:
Blocked by: Blocking:
Description

I have a table to which I've assigned attributes to each row like so:

<table>

<tr myId='1'><td>Some Content Here</td></tr>

<tr myId='2'><td>Some Content Here</td></tr>

<tr myId='3'><td>Some Content Here</td></tr>

</table>

I also have a button which the user can toggle hide/show all the rows using the following javascript code:

if(hide == true)

{

$("tr[myId!=' ']").hide();

}

else

{

$("tr[myId!=' ']").show();

};

When this code is run, instead of only hiding the rows that have a myId attribute, it hides ALL the table rows on the page, even for other tables.

This had been working correctly in version 1.2.6.

Attachments (0)
Change History (1)

Changed August 18, 2009 12:42AM UTC by dmethvin comment:1

component: unfilledselector
resolution: → invalid
status: newclosed

http://docs.jquery.com/Selectors/attributeNotEqual#attributevalue

"Matches elements that either don't have the specified attribute or do have the specified attribute but not with a certain value."

Sounds like this is a bug with 1.2.6 that was fixed in 1.3; I'd change your selector to limit it to the table with rows that all have a myId attribute.