Results 1 to 5 of 5

Thread: Grid - RowExpander-Plugin in initComponent - Cannot read property query of undefined

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-23236 in 6.2.2.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2015
    Posts
    22

    Default Grid - RowExpander-Plugin in initComponent - Cannot read property query of undefined

    The software configures the RowExpander-Plugin in the initComponent method of a grid.

    Ext.grid.header.Container overrides the removeAll method since version 6.2.1 and fires a columnchanged-Event. This causes an Uncaught TypeError: Cannot read property 'query' of undefined in the
    onColumnsChanged method of Ext.grid.feature.RowBody because this.view.el is undefined.

    The fiddle shows the problem

    https://fiddle.sencha.com/#fiddle/1lme&view/editor

    It will display the grid using extjs 6.2.0 but doesn't work anymore using 6.2.1

    Do we have to try to change our code because we do something we shouldn't do or is this a bug that can be fixed in the extjs code?

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

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    7

    Default

    We're seeing this as well, in our case it's caused by loading state. That makes things interesting because it becomes hard to reproduce: you'd have to have non-default state stored on the grid before it happens. But then it's a hard crash and broken app.

    In this example, you'll have to move a column and then rerun:
    https://fiddle.sencha.com/#fiddle/1mcc



    Code:
    onColumnsChanged (RowBody.js:213)
    fire (Event.js:477)
    doFireEvent (Observable.js:815)
    doFireEvent (Component.js:3105)
    prototype.doFireEvent (EventDomain.js:295)
    fireEventArgs (Observable.js:654)
    fireEvent (Observable.js:607)
    removeAll (Container.js:576)
    applyColumnsState (Container.js:643)
    applyState (Table.js:1367)
    callParent (Base.js:1423)
    applyState (PanelBase.js:98) (app code)
    initState (Stateful.js:351)
    constructor (Stateful.js:165)
    constructor (Component.js:2149)
    callParent (Base.js:1423)
    constructor (Table.js:507)
    callParent (Base.js:1423)

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Phoenix, AZ
    Posts
    651

    Default

    Any overrides for this? We use the row expander heavily.

  5. #5
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Phoenix, AZ
    Posts
    651

    Default

    Code:
    Ext.define('EXTJS_23236.grid.feature.RowBody', {
        override: 'Ext.grid.feature.RowBody', 
        // When columns added/removed, keep row body colspan in sync with number of columns.
        onColumnsChanged: function(headerCt) {
            var view = this.view,
                items, colspan, len, i;
    
    
            if (!view.rendered) {
                return;
            }
    
    
            items = view.el.query(this.rowBodyTdSelector);
            colspan = headerCt.getVisibleGridColumns().length;
            len = items.length;
    
    
            for (i = 0; i < len; ++i) {
                items[i].setAttribute('colSpan', colspan);
            }
        }
    });

Similar Threads

  1. [CLOSED] Grid - Cannot read property 'scroll' of undefined
    By LesJ in forum Ext JS 6.x Bugs
    Replies: 4
    Last Post: 30 Oct 2016, 12:55 PM
  2. Cannot read property 'features' of undefined with touch.grid
    By novadys-sbu in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 27 Nov 2015, 2:48 AM
  3. Replies: 3
    Last Post: 19 Sep 2014, 8:55 AM
  4. Replies: 1
    Last Post: 20 Jun 2012, 2:03 PM
  5. Replies: 5
    Last Post: 15 Jan 2012, 4:40 PM

Tags for this Thread

Posting Permissions

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