Hi.
Thanks for this - just what I needed. Here is a slight suggested modifcation so that you can call setBadgeText() method before it is rendered:I just moved the test for rendered up a bit and added an else clause. That solved my problem.PHP Code:
setBadgeText: function(text) {
text = text || '';
var me = this,
oldBadgeText = me.badgeText || '';
if (text != oldBadgeText) {
if (me.rendered) {
if (Ext.isEmpty(text)) {
me.btnBadge.addCls('hide-badge');
} else {
me.btnBadge.removeCls('hide-badge');
}
me.badgeText = text;
me.btnBadge.update(text || '');
//me.setComponentCls();
if (Ext.isStrict && Ext.isIE8) {
// weird repaint issue causes it to not resize
me.el.repaint();
}
//me.updateLayout();
} else {
me.badgeText = text;
}
me.fireEvent('badgetextchange', me, oldBadgeText, text);
}
return me;
}
Cheers,
Murray
Thanks for code
As I wrote before I'll move this into github so it will be easier to modify.
Looking cool!Any plans to upgrade for ExtjS 5?
Currently no, because I'm not using ExtJS, but probably in couple of weeks I'll start learning ExtJS5 and this will be one of things I'll migrate.
But if You convert code by Yourself please share![]()
Hi! misiu have you started upgrading the badge button extension for ExtJs 5 version. If you have finished the upgrading process means please share it here we are waiting for your upgraded plugin for my browser.
works on ExtJs 5?
Wemerson Januario @JanuarioCoder
Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
____________________________________________
Hire me on UpWork:
GitHub
https://github.com/wemersonjanuario
Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!
Sorry guys, I didn't have time to test it in ExtJS5. Please try that and report any problems.
I just started ExtJS5 so I definitely will rewrite this, but I can't say when it will happen.
I thing I'll go with plugin this time.
I created this on badge plugin that is available on forum.
Please test this and comment here.
If there will be Extension forum in ExtJS5 session I'll post this there.
BTW: What is better: plugin for button or custom button?
Can someone more experience than me give some comments on this?
I simplified this plugin a bit, not it only adds badge element when needed.
but still this is work in progress.