ExtJS error in nested grids: unable to read isGroupHeader property from null

whenever I expand or collapse a row in a nested grid, I get the following error:

"Uncaught TypeError: Unable to read property isGroupHeader 'null"

google gave me this url but it doesn't work in 5.1, any idea how to convert it to solve 5.1 problem?

http://blog.kondratev.pro/2014/08/getting-rid-of-annoying-uncaught.html

Here is a sample script for the error: https://fiddle.sencha.com/#fiddle/g5b

+3


source to share


3 answers


This happens because a grid event or cell editor (mouseover, click, or whatever) is fired in the context of another grid (parent or ancestor). You can see how to stop bubbling events here:



Ext.require(['Nested.view.NestedGrid'], function() {
    var nGrid = Ext.create({
        type: 'nestedgrid',
        renderTo: div
    });

    // prevent bubbling of the events
    nGrid.getEl().swallowEvent([
        'mousedown', 'mouseup', 'click',
        'contextmenu', 'mouseover', 'mouseout',
        'dblclick', 'mousemove'
    ]);

});

      

+2


source


Find the original error method ext-all-debug.js and then create a new js in the "ext-all *. Js" folder after download, my version is: Ext JS 6.2.0.981

The key code is: Object. prototype

.function andxxx != null



Postfix code:

Ext.event.publisher.Dom.prototype.unsubscribe = function (element, eventName, delegated, capture) {
    var me = this,
        captureSubscribers, bubbleSubscribers, subscribers, id;
    if (delegated && !me.directEvents[eventName]) {
        captureSubscribers = me.captureSubscribers;
        bubbleSubscribers = me.bubbleSubscribers;
        subscribers = capture ? captureSubscribers : bubbleSubscribers;
        if (subscribers != null && subscribers[eventName]) {
            --subscribers[eventName];
        }
        if (me != null && bubbleSubscribers != null && captureSubscribers != null && !me.handles[eventName] && !bubbleSubscribers[eventName] && !captureSubscribers[eventName]) {
            // decremented subscribers back to 0 - and the event is not in "handledEvents"
            // no longer need to listen at the dom level
            this.removeDelegatedListener(eventName);
        }
    } else {
        subscribers = capture ? me.directCaptureSubscribers : me.directSubscribers;
        id = element.id;
        subscribers = subscribers[eventName];
        if (subscribers[id]) {
            --subscribers[id];
        }
        if (!subscribers[id]) {
            // no more direct subscribers for this element/id/capture, so we can safely
            // remove the dom listener
            delete subscribers[id];
            me.removeDirectListener(eventName, element, capture);
        }
    }
};

      

0


source


Ext.define('MyApp.overrides.GridColumn', {
    override: 'Ext.grid.column.Column',

    show: function () {
        if (!this.getRefOwner()) {
            return;
        }
        this.callParent(arguments);
    }
});

      

Here is a workaround for this that I am using.

0


source







All Articles