Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Hide Buttons on Toolbar
posted

I have an issue with the WebToolbar that I can't seem to figure out.

We need to hide the second last button on hour toolbar (on the client side). We don't want to just disable it.

The way I am currently hiding the button is to get a reference to that button and hide it's element. TD

tbButton.Element.style.display = "none";

The problem is that all the buttons are 25px except that button which is 120px. When I hide it the next button is now 120px not 25px. I think this is happening because of the width specified in the colHeader. This is a problem because I am using CSS Sprites (background-image + background-position) to display the icons in the toolbar for performance reasons and now the last button is showing too much of the background-image because of the width problem.

Is there a way that I can hide the whole column of an HTML table using javascript? 

Or does anyone have any other ideas? I'd appreciate any suggestions anyone might have.

Thanks,

 Amy

Parents
No Data
Reply
  • 19308
    posted

    The toolbar auto fills when button widths aren't specified.  You'll want to specify an ItemWidthDefault on the toolbar to prevent it from filling itself with the last item.  You can also set the width explicitly on each toolbar item.  Even though your using sprites with CSS, you should still have the ability to set an item-width on the server, right?  If not, I'm sure there's a combination of css that can get you where you need to be, but it may not be very pretty.  Smile 

    You can also use tbButton.Element.style.visibility="hidden" to hide the button, but preserve the layout.  I'd probably go this route if you can, as it's a pretty quick and easy change.

    -Tony

Children