`

EXT中Tabpanel中加入RowExpander,导致Tabpanel不能正常关闭的解决办法

阅读更多
异常描述:Tabpanel中加入应用了RowExpander.js插件的Grid,当点击关闭Tabpanel时,浏览器
          报出 this.grid.getView().mainBody未定义。
异常解决:在RowExpander.js的源码中第139行的onDestroy方法中添加mainBody是否存在的判断
            onDestroy: function() {
                                this.keyNav.disable();
                                delete this.keyNav;
                                var mainBody = this.grid.getView().mainBody;
                                if(mainBody!=undefined){
                                   mainBody.un('mousedown', this.onMouseDown, this);
                                 }
                                },
异常备注:Tabpanel触发close事件的时候,会去销毁底下相应的DOM,移除了GRID后,再触发了           
          RowExpander插件的onDestory()事件,此时GRID已经不存在了,因此找不到mainBody
          这个元素,引发异常

0
0
分享到:
评论
1 楼 NullPointException-4 2011-10-10  
gaoyin

相关推荐

Global site tag (gtag.js) - Google Analytics