Hybrid View

    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
    147
    Vote Rating
    0
    darkpriest 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
    179
    Vote Rating
    35
    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
    179
    Vote Rating
    35
    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
    147
    Vote Rating
    0
    darkpriest 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
    147
    Vote Rating
    0
    darkpriest 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
    179
    Vote Rating
    35
    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.