dijit.form.Button versteckenHide dijit.form.Button

In order to hide dijit.form.Buttons (and other dijits for that matter) you need to access the dijit’s DOM element and set the CSS styles visibility and display correspondingly, like so:

dojo.style(dijit.byId('yourDijit').domNode, {
  visibility: (hideMe ? 'hidden' : 'visible'),
  display: (hideMe ? 'none' : 'block')
});

You may also like...

2 Responses

  1. Rahul says:

    Hi Matthias,

    I am trying to hide some of the buttons in DOJO Toolbar. But when I hide, there is an empty space left behind. Any idea how to fix this?

    • Hi Rahul,

      please make sure to set the appropriate CSS to display:none. I’m guessing that you are using visibility:hidden which hides the target elements but leaves the new empty space untouched. Hope that helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.