Reputation: 4031
I have the following code written in Dojo. It works fine and as expected in all browsers except Firefox (25,26) The error from the console is: typeError: this.getParent() is null
which is really not helpfull a lot.
The onclick event does't fire giving the above mentioned error.
Where could the problem be:
var pMenu = new dijit.Menu({
targetNodeIds: [ContainerNode]
});
var t = new dijit.MenuItem({
label: "test",
iconClass: "context_paste",
});
dojo.connect(t, 'onclick', function(){alert("test")});
Upvotes: 1
Views: 218
Reputation: 5080
I created a fiddle and filled in the missing code and was not able to reproduce the error on Firefox 25. Some of the changes that I made were:
iconClass
lineplaceAt(pMenu)
http://jsfiddle.net/RichAyotte/okvp0hpu/
dojo.require('dijit.Menu');
dojo.require('dijit.MenuItem');
dojo.addOnLoad(function() {
var ContainerNode = document.getElementById('container');
var pMenu = new dijit.Menu({
targetNodeIds: [ContainerNode]
});
var t = new dijit.MenuItem({
label: "test",
iconClass: "context_paste"
}).placeAt(pMenu);
dojo.connect(t, 'onClick', function(){alert("test")});
});
Upvotes: 1