Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-5707 in a recent build.
  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    5
    Vote Rating
    0
    robdurkin is on a distinguished road

      0  

    Default Exception editing grid: Uncaught TypeError: Cannot read property 'viewIndex' of null

    Exception editing grid: Uncaught TypeError: Cannot read property 'viewIndex' of null


    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.1.0 Beta 2

    Browser versions tested against:
    • Chrome 16.0.912.77 m

    Description:
    • Exception is thrown when attempting to edit a cell in an editable grid panel. Error occurs when I double-click in a cell to begin the edit.

    The result that occurs instead:
    Code:
    Uncaught TypeError: Cannot read property 'viewIndex' of null   
    Ext.define.indexOf                                                    AbstractView.js:927
    Ext.define.getEditingContext                                          /ext/4/src/grid/plugin/Editing.js:445
    Ext.define.startEdit                                                  /ext/4/src/grid/plugin/Editing.js:410
    Base.implement.callParent                                             ext-debug.js:5924
    Ext.define.startEdit                                                  /ext/4/src/grid/plugin/RowEditing.js:117
    Ext.define.startEditByClick                                           /ext/4/src/grid/plugin/Editing.js:390
    Base.implement.callParent                                             ext-debug.js:5924
    Ext.define.startEditByClick                                           /ext/4/src/grid/plugin/RowEditing.js:239
    fire                                                                  ext-debug.js:12969
    Ext.define.continueFireEvent                                          Observable.js:282
    Ext.define.fireEvent                                                  Observable.js:255
    Ext.override.fireEvent                                                EventBus.js:22
    Ext.define.processItemEvent                                           Table.js:759
    Ext.define.processUIEvent                                             View.js:472
    Ext.define.handleEvent                                                View.js:411
    (anonymous function)
    wrap

    Test Case:


    Code:
    plugins: [
        Ext.create('Ext.grid.plugin.RowEditing', {
            clicksToMoveEditor: 1,
            clicksToEdit: 2                                               
        })
    ]



    Operating System:
    • Windows 7 Ultimate

  2. #2
    Sencha User
    Join Date
    Dec 2010
    Posts
    5
    Vote Rating
    0
    robdurkin is on a distinguished road

      0  

    Default


    I might also mention that this exception is not thrown with version 4.0.7.

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,999
    Vote Rating
    649
    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


    Can't reproduce this, please post a full test case.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha User
    Join Date
    Apr 2008
    Location
    France
    Posts
    72
    Vote Rating
    0
    eyetv is on a distinguished road

      0  

    Default


    I' have the same error with this code

    PHP Code:
    Ext.define('classes.organismes.grilleServeursGed', {
        
    extend'Ext.grid.Panel',
        
    alias'widget.grilleServeursGed',
        
        
    statefulfalse,
        
    width:375,
        
    height:160,
        
        
        
    initComponent: function() {
            var 
    me=this;
            
        
            
    MB_ajoutServeurGed= new Ext.Action({
                
    text'Ajouter un serveur',
                
    iconCls'btnAddServeurGed',
                
    handler  : function(){
                    
    me.getStore().add({destinataires''});
                }
            });
            
            
    this.store=Ext.create('Ext.data.Store',{
                
    fields:[{name:'serveur'}]        
            });
            
            
            
    this.columns =[{
                
    id:'serveurs',
                
    header:'Serveurs',
                
    sortable:true,
                
    hideable:false
                
    dataIndex:'serveur',
                
    flex1,
                
    editor: {
                    
    xtype'textfield',
                    
    allowBlankfalse
                    
    }
                },{
                    
    xtype'actioncolumn',
                    
    width:30,
                    
    hideablefalse,
                    
    sortablefalse,
                    
                    
    items:[{
                        
    icon:'../../ressources/img/delete.gif',
                        
    tooltip:'Supprimer le serveur',
                        
    handler: function(gridrowIndexcolIndex) {
                            
    me.getStore().removeAt(rowIndex); 
                        }
                    }]
                }
            ],
        
            
    this.plugins=[
                
    Ext.create('Ext.grid.plugin.CellEditing', {
                    
    clicksToEdit1
                
    })
            ],
            
            
    this.tbar=[MB_ajoutServeurGed],
            
            
            
    this.listeners={
                
    edit: function(editore){
                    
    e.record.commit();
                }
            },
            
            
    this.callParent(arguments);
        }
        
        
    }); 
    the error occurs with the line

    PHP Code:
    me.getStore().removeAt(rowIndex); 
    Without Ext.grid.plugin.CellEditing it's OK

    I use extjs 4.1 RC1

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      1  

    Default


    It seems that ActionColumn does not play well with CellEditing.

    As a workaround, try configuring your ActionColumn with

    Code:
    editor: null

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    OK, maybe 50/50 here...

    You are deleting the record in the Action handler.

    And then the editing plugin carries on and looks up the clicked upon record in the Store to try to edit it.

    It's no longer there...

  7. #7
    Sencha User
    Join Date
    Apr 2008
    Location
    France
    Posts
    72
    Vote Rating
    0
    eyetv is on a distinguished road

      0  

    Default


    thank you for the reply, I changed my code, I had a listener to Ext.grid.plugin.CellEditing

    PHP Code:
    this.plugins=[
        
    Ext.create('Ext.grid.plugin.CellEditing', {
            
    clicksToEdit1,
            
    listeners:{
                
    beforeedit: function(eeOpts){
                    if(
    eOpts.colIdx==1){
                        
    me.getStore().removeAt(eOpts.rowIdx);
                        return(
    false);
                    }        
                }
            }
        })
    ], 
    and in actioncolumn, removed handler
    No error

Thread Participants: 3