0

I'm trying to create a dojo Button and set it inside a spanned on 2 rows table cell toking the whole presented height inside it, anyway due some reason it does not works.

require( [  "dijit/form/Button" , "dojo/dom", "dojo/parser"],
  function(  Button, dom, parser )
  {
     var buttonExecuteQuery = new Button(
     {
           id        : "btnExecuteQuery",
           busyLabel : "Изпълнява",
           label     : "Изпълни",                    
           style     : "height:100%",
           height    : "100%"
     });
})
  • How to setup Dojo's Button height ?
Castro Roy
  • 7,623
  • 13
  • 63
  • 97
Yordan Yanakiev
  • 2,546
  • 3
  • 39
  • 88

1 Answers1

0

The correct way following your syntax is style: "height:100%"

var buttonExecuteQuery = new Button(
    {
        id        : "btnExecuteQuery",
        busyLabel : "Изпълнява",
        label     : "Изпълни",                    
        style     : "height:100%"
    }
);

height: "100%" does nothing. Now, the most important part, you need to understand that height: "100%" only works if the height of the parent is known, for example, if you want the button to occupy the full height of a div, then you must set the height of that div

<div style="height: 50px">
    <button style="height: 100%">My Button</button>
</div>

the are a lot of discussion of this topic here in SO, for example you can read
Make div 100% height of browser window
height:100%; not working
CSS height 100% percent not working

Hope it helps

Community
  • 1
  • 1
Castro Roy
  • 7,623
  • 13
  • 63
  • 97
  • Hello Castro Roy. On which version of dojo this works ? Because it does not work seems like on v10. ( or maybe it's my mistake ). It works only if I do clean html/js – Yordan Yanakiev Nov 07 '16 at 15:07
  • I'm testing with dojo `1.10`. If you pass it in the constructor, `new Button({style: "height:100%"})`, check your html, it will be there, then, you just need to follow the other links a gave to make `height:100%` works, make sense? Also, you can use a css class if you don't want to use inline style – Castro Roy Nov 07 '16 at 15:43
  • can You post in https://jsfiddle.net playground the source You are testing please. – Yordan Yanakiev Nov 09 '16 at 11:07