Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Nov 2007
    Location
    Germany
    Posts
    164
    Vote Rating
    0
    Michi_72 is on a distinguished road

      0  

    Default MVC - Actioncolumn Event fires twice

    MVC - Actioncolumn Event fires twice


    Hello,

    after changing to 4.2.0 beta i have the following problem.

    In the grid i have configured an action column like this:

    PHP Code:
    {
      
    xtype 'actioncolumn',
      
    width 20,
      
    items : [
      {
        
    icon    'system/icons/page_white_acrobat.png',
        
    handler : function(gridrowIndexcolIndex) {
        
    this.fireEvent('show_pdf'thisgridrowIndexcolIndex);
        }
      }
      ]

    In the controller the init function looks like this:

    PHP Code:
    init: function() { 
        
    this.control({
                
    'system_info actioncolumn': { 
                    
    show_pdfthis.onShowPDF
                
    }
            })
    },
    onShowPDF: function(viewcellrowcole){
        
    console.log('TEST')

    The console logs the text 'TEST' twice, when the action column is clicked - in 4.1.1 it logs 'TEST' once.

    Any tips?

    Thanks in advance.

    Michi

  2. #2
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    197
    Vote Rating
    38
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Thanks for reporting this issue, we're looking into it.

    Regards,
    Alex.

  3. #3
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    197
    Vote Rating
    38
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Can't reproduce this problem in my setup. Can you post more code please?

    Regards,
    Alex.

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Location
    Germany
    Posts
    164
    Vote Rating
    0
    Michi_72 is on a distinguished road

      0  

    Default


    Hello,

    here is more code for this problem:

    The controller code:

    PHP Code:
    Ext.define('AM.controller.system.info', {
        
    extend'Ext.app.Controller',
        require: 
    'Ext.ux.RowExpander',
        
    views:  [ 'system.info''nav.system_details' ],
        
    stores: [ 'nav.system_update' ],
        
    models: [ 'nav.system_update' ],
            

        
    init: function() { 
                    
            
    this.control({
                
                
    'system_info actioncolumn': { 
                    
    show_pdfthis.onShowPDF
                
    },
                
    'system_info': {
                        
    close: function () { 
                            
    Ext.getCmp('center_id').getActiveTab().close();
                        }
                },
                
    'system_info grid': {
                        
    //Bei diesem Event muss das Layout des Tabs neu gerechnet werden, wegen event. Srollbar...
                        
    groupclick: function(view){
                            
    view.up('tabpanel').getActiveTab().doLayout();
                        }
                }
            });
        },
        
        
    onShowPDF: function(viewcellrowcole){     console.log('TEST')
        }
    }); 
    The view:

    PHP Code:
    Ext.Loader.setPath('Ext.ux''system/extjs/examples/ux/');

    Ext.require([ 'Ext.ux.RowExpander' ]);

    Ext.define('AM.view.system.info' ,{
        
    extend'Ext.tab.Panel',
        
    alias 'widget.system_info',
        
    iconCls 'settings',
        
    height200,
        
    title 'Systeminformation',
        
    activeTab0,
        
        
    initComponent: function() {
           
            
    this.items = [
                  {
                    
    xtype           'system_details',
                    
    title           'Allgemein',
                    
    nameColumnWidth 170,
                    
    iconCls         ''
                
    },
                {

                    
    xtype      'gridpanel',
                    
    title      'Updateverlauf',
                    
    store      'nav.system_update',
                    
    columns    : [
                    {
                        
    text            'Build kalkTOOL',
                        
    flex            1,
                        
    dataIndex       'prg_version',
                        
    summaryType     'count',
                        
    summaryRenderer : function(value) {
                            return ((
    value === || value 1) ? '' value ' Patches' '1 Patch');
                        }
                    },
                    {
                        
    text      'Kategorie',
                        
    dataIndex 'prg_kategorie'
                    
    },
                    {
                        
    text      'Datum',
                        
    dataIndex 'prg_time_real',
                        
    renderer  Ext.util.Format.dateRenderer('d.m.Y H:i')
                    },
                    {
                        
    xtype 'actioncolumn',
                        
    width 20,
                        
    items : [
                        {
                            
    icon    'system/icons/page_white_acrobat.png',
                            
    handler : function(gridrowIndexcolIndex) {
                                
    this.fireEvent('show_pdf'thisgridrowIndexcolIndex);
                            }
                        }
                        ]
                    }
                    ],
                    
    viewConfig :
                    {
                        
    stripeRows  true,
                        
    loadingText 'Daten werden geladen...'
                    
    },
    //                toFIX Dieses Plugin ist defekt in 4.2.0 beta                
    //                

                    
    plugins    : [
                    {
                        
    ptype      'rowexpander',
                        
    rowBodyTpl : ['<p><b>Informationen zum Patch:<br><br></b> {prg_text}</p>'
                        
    ]
                    }
                    ]
                }

                ];
            
          
    this.callParent(arguments);
        }
    }); 
    The store:

    PHP Code:
    Ext.define('AM.store.nav.system_update',
        {
            
    extend     'Ext.data.Store',
            
    model      'AM.model.nav.system_update',
            
    autoLoad   true,
            
    groupDir   'DESC',
            
    groupField 'prg_time_year',
            
    proxy      :
            {
                
    type   'ajax',
                
    url    'prg/system_updateverlauf/system_updateverlauf_db.php',
                
    reader :
                {
                    
    root          'data',
                    
    totalProperty 'count',
                    
    id            'id'
                
    }
            }
        }); 
    And the model:

    PHP Code:
    Ext.define('AM.model.nav.system_update',
        {
            
    extend     'Ext.data.Model',
            
    fields     : [
            {
                
    name 'id',
                
    type 'int'
            
    },
            {
                
    name 'prg_version'
            
    },
            {
                
    name       'prg_time_real',
                
    type       'date',
                
    dateFormat 'Y-m-d H:i:s'
            
    },
            {
                
    name    'prg_time_year',
                
    convert : function(valuerecord) {
                    
    prg_time_year record.data.prg_time_real.getFullYear();
                    return 
    prg_time_year;
                }
            },
            {
                
    name 'prg_kategorie'
            
    },
            {
                
    name 'prg_text'
            
    },
            {
                
    name 'prg_document_path'
            
    }
            ],
            
    idProperty 'id'
        
    }); 
    The os is windows 7 and browser is chrome 23.0.1271.97 m.

    Thanks!

    Michi

  5. #5
    Sencha User
    Join Date
    Nov 2007
    Location
    Germany
    Posts
    164
    Vote Rating
    0
    Michi_72 is on a distinguished road

      0  

    Default


    Hello,

    any Ideas? How can i debug where the event is fired?

    Thanks!

    Michi

  6. #6
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    197
    Vote Rating
    38
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Hi Michi,

    Sorry, holidays intervened. :) Looking into it now.

    Regards,
    Alex.

  7. #7
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    197
    Vote Rating
    38
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Still can't reproduce it on the latest codebase. When I click on the icon, console logs 'TEST' once per click. Could it be that you handle this particular event somewhere else and log additional message there?

    Regards,
    Alex.

  8. #8
    Sencha User
    Join Date
    Nov 2007
    Location
    Germany
    Posts
    164
    Vote Rating
    0
    Michi_72 is on a distinguished road

      0  

    Default


    Hello Alex,

    thanks for your reply.

    I still think it is a problem with 4.2 beta, cause with 4.1.1 this behaviour is not occured!

    Is there a possibility to catch from where the event is fired twice?

    When will the next beta or RC1 released?

    Thanks!

    Michi

  9. #9
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    197
    Vote Rating
    38
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Michi,

    This may have been a problem with 4.2 Beta 1, but since then a big chunk of MVC code has been merged, so the situation has changed. Hey, that's what betas are for! :) Beta 2 should be available Real Soon Now.

    As for tracing where it comes from, I'd suggest waiting for Beta 2 and trying this code with it. If it still fires twice, place debugger statement in the event handler and go up the stack to see where the event comes from. Chances are it's a similar chunk of code somewhere else in your application; you can try to differentiate by logging something else than just "TEST".

    Regards,
    Alex.

  10. #10
    Sencha User medley's Avatar
    Join Date
    Apr 2008
    Location
    Luxembourg
    Posts
    128
    Vote Rating
    0
    medley is on a distinguished road

      0  

    Default


    Hello,

    I am using ExtJS 4.2.0 and I have the similar problem. The event is fired twice.

    Regards
    Medley