Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Ext.ux.button.BadgeButton

  1. #11
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    264

    Default

    Quote Originally Posted by winitsw View Post
    Thanks for the quick reply and fix.
    No problem

    In free time I'll move this to GitHub so it will be easier to manage.
    Maybe ExtJS5 will have this build in, will see.

  2. #12
    Sencha User murrah's Avatar
    Join Date
    Oct 2007
    Location
    Katoomba, Blue Mountains, west of Sydney, Australia
    Posts
    400

    Default

    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:
    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'meoldBadgeTexttext);
            }
            return 
    me;
        } 
    I just moved the test for rendered up a bit and added an else clause. That solved my problem.

    Cheers,
    Murray

  3. #13
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    264

    Default

    Thanks for code
    As I wrote before I'll move this into github so it will be easier to modify.

  4. #14
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Moldova, Republic of / Shelton, CT, US
    Posts
    154

    Default

    Looking cool!Any plans to upgrade for ExtjS 5?

  5. #15
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    264

    Default

    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

  6. #16

    Default

    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.

  7. #17
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    872

    Default

    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Á!

  8. #18
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    264

    Default

    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.

  9. #19
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    264

    Default

    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?

  10. #20
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    264

    Default

    I simplified this plugin a bit, not it only adds badge element when needed.



    but still this is work in progress.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •