1. #1
    Ext User
    Join Date
    Apr 2007
    Posts
    168
    Vote Rating
    0
    SmyersM is on a distinguished road

      0  

    Default [2.0][FIXED] ColorPicker fires 3 'select' events

    [2.0][FIXED] ColorPicker fires 3 'select' events


    Code:
    m_menu = new Ext.menu.Menu({
    		defaults: {
    			hideDelay: 0
    		}
    	  , items: [{
    	  	  text: 'Manage this course'
    	  	, handler: function() {
    	  		_startAdvancedMode(m_activeCourse);
    	  	}
    	  },{
    	  	  text: 'Change the color'
    	  	, menu: new Ext.menu.ColorMenu({
    	  		listeners: {
    	  			select: function() { 
    	  				alert('test');
    	  			}
    	  		}
    	  	})
    	  },{
    	  	  text: 'Preview course changes'
    	  	, handler: function() {
    	  		_startPreviewModePane(m_activeCourse);
    	  	}
    	  }	,m_lockCourse
    	  	,m_unlockCourse
    	  	,'-',{
    	  	  text: 'Remove course' 
    	  	, handler: function() {
    	  		My.Application.Model.removeCourse(m_activeCourse);
    		}
    	  }]
    });
    3 'test' alerts fire.


    if i change the code to

    Code:
    	  },{
    	  	  text: 'Change the color'
    	  	, menu: new Ext.menu.ColorMenu({
    	  		handler: function() { 
    	  				alert('test');
    	  			}
    	  		}
    	  	})
    	  },{
    two 'test' alerts fire

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    2
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    Moved to bugs forum. Not sure about the issue, but we'll take a look.

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    SmyersM -

    After looking into your sample we have uncovered the issue.

    ColorMenu's which setup event handling via the on method will not be affected, however ColorMenu's which use the listeners config option will be. Therefore you can setup event handling after creating your ColorMenu as a workaround until we have it resolved in SVN.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Location
    Iloilo, Philippines
    Posts
    149
    Vote Rating
    1
    willydee is on a distinguished road

      0  

    Default


    Since this bug is still present in 2.2, is there any progress?
    Kind regards,
    WillyDee

    Problems worthy of attack, prove their worth by hitting back.

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    You could use this override (well, actually more a replacement):

    Code:
    Ext.menu.ColorItem = function(config){
        Ext.menu.ColorItem.superclass.constructor.call(this, new Ext.ColorPalette(
            Ext.applyIf({listeners: config.colorPaletteListeners||{}, handler: config.colorPaletteHandler||Ext.emptyFn}, config)), config);
        this.palette = this.component;
        this.relayEvents(this.palette, ["select"]);
        if(this.selectHandler){
            this.on('select', this.selectHandler, this.scope);
        }
    };
    Ext.extend(Ext.menu.ColorItem, Ext.menu.Adapter);
    Ext.menu.ColorMenu = function(config){
        Ext.menu.ColorMenu.superclass.constructor.call(this, config);
        this.plain = true;
        var ci = new Ext.menu.ColorItem(Ext.applyIf({listeners: config.colorItemListeners||{}}, config));
        this.add(ci);
        this.palette = ci.palette;
        this.relayEvents(ci, ["select"]);
    };
    Ext.extend(Ext.menu.ColorMenu, Ext.menu.Menu);
    (don't pass ColorMenu listeners to internal ColorItem and don't pass ColorItem listeners and handler to internal ColorPalette)
    Last edited by Condor; 24 Sep 2008 at 5:51 AM. Reason: Changed to allow specifying listeners for inner components.

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Bumping, as this seems pretty old now and still appears to be an issue.....in dateMenu as well:

    http://extjs.com/forum/showthread.ph...332#post228332

  7. #7
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    The same fix can be applied to DateMenu/DateItem:

    Code:
    Ext.menu.DateItem = function(config){
    	Ext.menu.DateItem.superclass.constructor.call(this, new Ext.DatePicker(
    		Ext.applyIf({listeners: config.datePickerListeners||{}, config)), config);
    	this.picker = this.component;
    	this.addEvents('select');
    	this.picker.on("render", function(picker){
    		picker.getEl().swallowEvent("click");
    		picker.container.addClass("x-menu-date-item");
    	});
    	this.picker.on("select", this.onSelect, this);
    };
    Ext.extend(Ext.menu.DateItem, Ext.menu.Adapter, {
    	onSelect : function(picker, date){
    		this.fireEvent("select", this, date, picker);
    		Ext.menu.DateItem.superclass.handleClick.call(this);
    	}
    });
    Ext.menu.DateMenu = function(config){
    	Ext.menu.DateMenu.superclass.constructor.call(this, config);
    	this.plain = true;
    	var di = new Ext.menu.DateItem(Ext.applyIf({listeners: config.dateItemListeners||{}, config));
    	this.add(di);
    	this.picker = di.picker;
    	this.relayEvents(di, ["select"]);
    	this.on('beforeshow', function(){
    		if(this.picker){
    			this.picker.hideMonthPicker(true);
    		}
    	}, this);
    };
    Ext.extend(Ext.menu.DateMenu, Ext.menu.Menu, {
    	cls:'x-date-menu',
    	beforeDestroy : function() {
    		this.picker.destroy();
    	}
    });
    Last edited by Condor; 24 Sep 2008 at 5:51 AM. Reason: Changed to allow specifying listeners for inner components.

  8. #8
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Small note. I think some people are making code bold (like above????). On my box it's barely perceptible. I would suggest changing the color moreso than bolding, or doing both might be better. I'll post a screenshot so you can see what I mean.
    Attached Images

  9. #9
    Ext User
    Join Date
    Jun 2008
    Posts
    2
    Vote Rating
    0
    whisky-a-go-go is on a distinguished road

      0  

    Default


    A minor thing, but these lines:

    Code:
        Ext.menu.DateItem.superclass.constructor.call(this, new Ext.DatePicker(
            Ext.applyIf({listeners: config.datePickerListeners||{}, config)), config);
    Code:
        var di = new Ext.menu.DateItem(Ext.applyIf({listeners: config.dateItemListeners||{}, config));
    should be these:

    Code:
        Ext.menu.DateItem.superclass.constructor.call(this, new Ext.DatePicker(
            Ext.applyIf({listeners: config.datePickerListeners||{}}, config)), config);
    Code:
        var di = new Ext.menu.DateItem(Ext.applyIf({listeners: config.dateItemListeners||{}}, config));

  10. #10
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,119
    Vote Rating
    507
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Fixed in SVN.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar