Skip to content

Instantly share code, notes, and snippets.

@richso
Created December 28, 2013 15:08
Show Gist options
  • Save richso/8160365 to your computer and use it in GitHub Desktop.
Save richso/8160365 to your computer and use it in GitHub Desktop.
dgrid with dgrid/selector generate error "Uncaught TypeError: Cannot set property '_hasSelectorInputListener' of undefined" when destroyRecursive()
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@import "script/dojo183/dojo/resources/dojo.css";
@import "script/dojo183/dijit/themes/claro/claro.css";
@import "script/dojo183/dgrid/css/dgrid.css";
@import "script/dojo183/dgrid/css/skins/claro.css";
</style>
<script>
dojoConfig = {
async: true,
isDebug: true,
has:{
"dojo-firebug": true
},
parseOnLoad: true
};
</script>
<script type="text/javascript" src="script/dojo183/dojo/dojo.js"></script>
<script type="text/javascript">
require([
'dojo/ready',
"dijit/registry",
"dojo/_base/declare",
'dojo/store/Memory',
'dgrid/OnDemandGrid',
'dgrid/Selection',
'dgrid/selector',
'dgrid/extensions/DijitRegistry',
'dijit/layout/ContentPane',
'dojo/domReady!'
], function(ready, registry, declare, Memory, OnDemandGrid, Selection, selector, DijitRegistry){
var grid = new (declare([OnDemandGrid, Selection, selector, DijitRegistry]))({
store: new Memory({idProperty:'key', data:[{key:1, content:'test1'},{key:2, content:'test2'}]}),
selectionMode: "single",
columns: {
key: selector({ label: "Select", selectorType: "checkbox" }),
content: "Content"
}
}, "grid");
grid.startup();
});
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-id="testPane">
<div id="grid">
</div>
<button type="button" onClick="testPane.destroyRecursive()">
clear to error
</button>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment