X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/examples/ux/RowExpander.js diff --git a/examples/ux/RowExpander.js b/examples/ux/RowExpander.js index 377089cc..7d22ae3d 100644 --- a/examples/ux/RowExpander.js +++ b/examples/ux/RowExpander.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.0.0 + * Ext JS Library 3.1.0 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license @@ -137,10 +137,19 @@ Ext.ux.grid.RowExpander = Ext.extend(Ext.util.Observable, { // @private onDestroy: function() { - this.keyNav.disable(); - delete this.keyNav; + if(this.keyNav){ + this.keyNav.disable(); + delete this.keyNav; + } + /* + * A majority of the time, the plugin will be destroyed along with the grid, + * which means the mainBody won't be available. On the off chance that the plugin + * isn't destroyed with the grid, take care of removing the listener. + */ var mainBody = this.grid.getView().mainBody; - mainBody.un('mousedown', this.onMouseDown, this); + if(mainBody){ + mainBody.un('mousedown', this.onMouseDown, this); + } }, // @private onRowDblClick: function(grid, rowIdx, e) {