Results 1 to 5 of 5

Thread: [FIXED][DUP][3.0] ColorMenu et al

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408

    Default [FIXED][DUP][3.0] ColorMenu et al

    If you create a color menu like this:

    Code:
     new Ext.menu.ColorMenu({
        listeners:{
            select: ...
    Your select handler will get called twice. The color palette will get it from the initial config and it will get relayed to the menu which will then also call it.

    Code:
     Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {
        ...
        initComponent: function(){
            Ext.apply(this, {
                plain: true,
                showSeparator: false,
                items: this.palette = new Ext.ColorPalette(this.initialConfig)
            });
            Ext.menu.ColorMenu.superclass.initComponent.call(this);
            this.relayEvents(this.palette, ['select']);
        },

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Duplicate of this bugreport (same bug applies to DateMenu).

  3. #3
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    Fixed in SVN.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    This fixes are inconsistent.

    The fix in DateMenu applies initialConfig (Containing the listeners) to a config option containing listeners: null. The null will be overwritten, and the listeners will end up in the DatePicker.

    The fix in ColorMenu applies {listeners: null} to the initialConfig object before using that to create the ColorPalette.

    Mutating the initialConfig object is a Bad Idea. A Component does not own it. Outside application code owns it, and might reuse it to create other Components. Think factory function.

  5. #5
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    I've modified this, I don't think the solution is that great but upon instantiation it purges any listeners. On the odd case you want to bind a listener to the underlying component, then you can still do so manually.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

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