Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-6110 in a recent build.
  1. #1
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    215
    Vote Rating
    5
    christophe.geiser will become famous soon enough

      0  

    Default [4.1.0] Ext.view.AbstractView problem with indexOf

    [4.1.0] Ext.view.AbstractView problem with indexOf


    Hi all,
    indexOf in AbstractView is creating errors under some scenario.
    We should have
    Code:
        
    indexOf: function(node) {   node = this.getNode(node);
      // test for existence of node
       if(!Ext.isDefined(node)) {return -1}
      // end addition
       if (Ext.isNumber(node.viewIndex)) {
           return node.viewIndex;
        }
      return this.all.indexOf(node);
    }
    or something equivalent for avoiding the error I get: Uncaught TypeError: Cannot read property 'viewIndex' of null

    Cheers,
    C.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,884
    Vote Rating
    440
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thank you for the report!

    Regards,
    Scott

  3. #3
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    378
    Vote Rating
    2
    silcreval is on a distinguished road

      0  

    Default


    Also seeing this. Seems to be associated with a grid.

    In my case node is null, and returning -1 after a test for null just pushes the problem further down the line.

  4. #4
    Sencha User
    Join Date
    Feb 2011
    Posts
    61
    Vote Rating
    0
    jclark42796 will become famous soon enough

      0  

    Default


    I'm trying to determine if this is a related problem. I have a grid store that if I remove the store's content, store.removeAll(), and then repopulate the store via add() I get

    "node is null" where this.getNode(node) returns null.

    Code:
        indexOf: function(node) {
            node = this.getNode(node);
            if (Ext.isNumber(node.viewIndex)) {  // node is null here
                return node.viewIndex;
            }
            return this.all.indexOf(node);
        },
    I have no problems the first time the store is loaded.

    stack:

    Code:
    indexOf
    setPosition
    onViewRefresh()
    fire()
    continueFireEvent
    fireEvent(eventName="refresh")
    refresh()
    callParent
    refresh
    callParent
    refresh
    onAdd
    callAprent
    onAdd
    fire
    continueFireEvent(eventName="add"...)
    insert(index=0...)
    addSorted
    add
    .....
    Thanks,
    Jim

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    1
    Vote Rating
    0
    aaquibnawaz is on a distinguished road

      0  

    Default Getting the same error while removing the store contents and reinserting

    Getting the same error while removing the store contents and reinserting


    Hi can anyone help i am new to extjs and i am facing the same error while removing the store contents using store.removeAll() and reinserting using store.insert()

    TypeError: A is null [Break On This Error]
    if(Ext.isNumber(A.viewIndex)){return A.viewIndex}