PDA

View Full Version : Where can I find the bottom and right properties for a button in an absolute layout?



Lebenskuenstler
19 Mar 2012, 2:44 PM
Hi,

I am wondering why there are only x and y properties for components.
In normal HTML you are able to layout a button for example to the bottom right with the following style.

<button style="position: absolute; right: 5; bottom: 5">Click Me</button>

Why aren't there component properties for this purpose?
I know that I can archive this by setting the style of the button, but in my eyes this is only a bad hack.

Regards
Olaf

mitchellsimoens
20 Mar 2012, 8:44 AM
The layout should put the values on the outer element of the component which is a <div> for a button not the <button>

Lebenskuenstler
21 Mar 2012, 2:28 PM
Exact...

Now I am coding a Button like this

Ext.create('Ext.Button', {
text: 'Click me',
style: 'right: 5; bottom: 5'
}); which renders like this

<div class="x-btn....">
<em>
<button style="right: 5; bottom: 5"/>Click me</button>
</em>
</div>

But what I would prefer is

Ext.create('Ext.Button', {
text: 'Click me',
right: 5,
bottom: 5
}); which will render like this

<div class="x-btn...." style="right: 5; bottom: 5">
<em>
<button/>Click me</button>
</em>
</div>