PDA

View Full Version : [4.1.0 b2] Button html config not working



EZboy
30 Jan 2012, 12:20 PM
How to reproduce:

This no longer works (html config option does not appy)


Ext.create('Ext.Button', {
scale : 'large',
cls : 'mash_button',
html : '<div class="menu-button"><img class="icon" src="images/icons/icon.png" ><div class="content"><div class="title">Button</div><span class="text">Some text here</span></div></div>'
});


And this will work ( but height for html contents is not calculated properly):



Ext.create('Ext.Button', {
scale : 'large',
cls : 'mash_button',
text : '<div class="menu-button"><img class="icon" src="images/icons/icon.png" ><div class="content"><div class="title">Button</div><span class="text">Some text here</span></div></div>'
});


Is this intended behavior? Documentation states html config should be supported and working.

Thank you

mitchellsimoens
30 Jan 2012, 12:28 PM
The text config is the supported config. The html config will likely not have much affect.

EZboy
30 Jan 2012, 12:57 PM
Well, this is what the docs say for 4.1.0 b2:

html (http://172.19.240.116/%7Eyuriy/IMS/ext/ext-4.1.0-beta-2-1/docs/index.html#%21/api/Ext.AbstractComponent-cfg-html) : String (http://172.19.240.116/%7Eyuriy/IMS/ext/ext-4.1.0-beta-2-1/docs/index.html#%21/api/String)/Object (http://172.19.240.116/%7Eyuriy/IMS/ext/ext-4.1.0-beta-2-1/docs/index.html#%21/api/Object)An HTML fragment, or a DomHelper (http://172.19.240.116/%7Eyuriy/IMS/ext/ext-4.1.0-beta-2-1/docs/index.html#%21/api/Ext.dom.Helper) specification to use as the layout element content. The HTML content is added after the component is rendered, so the document will not contain this HTML at the time the render (http://172.19.240.116/%7Eyuriy/IMS/ext/ext-4.1.0-beta-2-1/docs/index.html#%21/api/Ext.AbstractComponent-event-render) event is fired. This content is inserted into the body before any configured contentEl (http://172.19.240.116/%7Eyuriy/IMS/ext/ext-4.1.0-beta-2-1/docs/index.html#%21/api/Ext.AbstractComponent-cfg-contentEl) is appended.
Defaults to: ""

So I am assuming html is supported config param?

It used to work in 4.0.X series, so I think it should work in 4.1.x

Thanks

mitchellsimoens
30 Jan 2012, 1:00 PM
It's inherited by it's superclass Ext.Component

EZboy
30 Jan 2012, 1:33 PM
Ok, so this option is no longer supported?