-
11 Dec 2011 3:51 PM #1
Button html is deprecated so how do you add html?
Button html is deprecated so how do you add html?
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???
-
11 Dec 2011 10:55 PM #2
setText should still accept HTML.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
12 Dec 2011 6:10 AM #3
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); } });
-
13 Dec 2011 5:19 PM #4
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(); } } });
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
14 Dec 2011 11:24 AM #5
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1235
in
2.0.


Reply With Quote