-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
<pre class="prettyprint lang-js">Ext.ns('Ext.ux.grid');\r
\r
<div id="cls-Ext.ux.grid.RowExpander"></div>/**\r
\r
// @private \r
onDestroy: function() {\r
- this.keyNav.disable();\r
- delete this.keyNav;\r
+ if(this.keyNav){\r
+ this.keyNav.disable();\r
+ delete this.keyNav;\r
+ }\r
+ /*\r
+ * A majority of the time, the plugin will be destroyed along with the grid,\r
+ * which means the mainBody won't be available. On the off chance that the plugin\r
+ * isn't destroyed with the grid, take care of removing the listener.\r
+ */\r
var mainBody = this.grid.getView().mainBody;\r
- mainBody.un('mousedown', this.onMouseDown, this);\r
+ if(mainBody){\r
+ mainBody.un('mousedown', this.onMouseDown, this);\r
+ }\r
},\r
// @private\r
onRowDblClick: function(grid, rowIdx, e) {\r
Ext.preg('rowexpander', Ext.ux.grid.RowExpander);\r
\r
//backwards compat\r
-Ext.grid.RowExpander = Ext.ux.grid.RowExpander;</pre> \r
-</body>\r
+Ext.grid.RowExpander = Ext.ux.grid.RowExpander;</pre>
+</body>
</html>
\ No newline at end of file