The "html" method on Button is now deprecated in favor of "text" in PR2 and PR3. So, how do you add HTML code to a button???
Printable View
The "html" method on Button is now deprecated in favor of "text" in PR2 and PR3. So, how do you add HTML code to a button???
setText should still accept HTML.
Doesn't work. Can you move this to the bug forum?
Code:Ext.application({
name: '2.0 PR3 Form Test',
launch: function() {
console.log('launch:');
var myPanel = Ext.create("Ext.Panel", {
fullscreen: true,
layout: 'fit',
items: [
{
xtype: 'container',
items: [
{
xtype: 'button',
text: '<div>test</div>'
}
]
}
]
});
console.log('myPanel=' + myPanel);
}
});
Fixed for the next release.
You can apply this override to your code to make it work until then:
When you use 'html', it will still say in the console that it is deprecated, but ignore that. This will work. :)Code:Ext.define('Ext.overrides.button.updateHtml', {
override: 'Ext.Button',
updateHtml: function(html) {
var element = this.textElement;
if (html) {
element.show();
element.update(html);
}
else {
element.hide();
}
}
});
Thanks. The patch worked.