aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Firefox problem when showing/hiding table rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Firefox problem when showing/hiding table rows" Watch "Firefox problem when showing/hiding table rows" New topic
Author

Firefox problem when showing/hiding table rows

Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Hi all,

I have run into some weird behaviour on Firefox.

I am hiding/showing table rows based on the radio button clicked by the user.
Everything works fine, except in one particular case, when the display for one of the rows gets distorted.

And the problem only appears in Firefox (tested on 1.5.* and 2 beta), and at least not on the latest versions of IE, Opera and Konqueror (ver. 3.4.2).

The following code is the most I could simplify my original code to, I tried to make the row names as explanatory as possible.
Click the radio box named 'R2,3,5 (Not OK)' to see the buggy behaviour.

I observed a couple of peculiar things -

1. On resizing the browser a fraction, the display is corrected.
2. If a row is made visible after the problematic row, the display stays ok. (Click on R5,6 (OK) to see this)

So, I am inclined to believe that this might be a bug in page rendering by the browser.
I would, of course, be happy to be proven wrong

For now, my work around is to add another row with the max no. of columns used and set its visibility to 'hidden', and that solution is working fine.
I would love to hear of a better suggestion though.

Cheers,
Sonny

P.S. Please remove the <remove_this> text in JavaScript event handlers (on<remove_this>load)



[EDIT - fixed formatting of the code block - Sonny]
[EDIT - fixed code according to Eric's advice - Sonny]
[EDIT - Tested OK on Konqueror - Sonny]
[ August 14, 2006: Message edited by: Sonny Gill ]
[ August 14, 2006: Message edited by: Sonny Gill ]

The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
To get table-row to work, do the following:


Eric
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Hi Eric,

Great tip, Thanks. I am using that now.

But, the original problem described in my post is still the same...any ideas on that?

I am hoping to get an opinion from people more experienced with JS/DOM, before I go through the trouble of downloading Mozilla nightly build and trying to reproduce the bug on that.

Cheers.

- Sonny
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Fixed code to include Eric' advice, tested on konqueror, and bumped up
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Firefox problem when showing/hiding table rows