嵌套网格中的ExtJS错误

嵌套网格中的ExtJS错误

本文介绍了嵌套网格中的ExtJS错误:无法读取null的属性'isGroupHeader'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在嵌套网格中展开或折叠行时,都会出现以下错误:

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

google给了我这个URL,但是它似乎在5.1中不起作用,不知道如何将其转换为解决5.1问题的方法吗?

google gave me this url , but it doesn't seems to 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

以下是该错误的小提琴示例: https://fiddle.sencha.com/#fiddle/g5b

Here is fiddle example for the error :https://fiddle.sencha.com/#fiddle/g5b

推荐答案

之所以会发生这种情况,是因为在另一个网格(父级或祖先)的上下文中触发了网格单元格或单元格编辑器事件(鼠标悬停,单击或任何其他操作).在这里,您可以查看如何阻止事件冒泡:

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

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'
    ]);

});

这篇关于嵌套网格中的ExtJS错误:无法读取null的属性'isGroupHeader'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 04:54