Call grandparent method in dojo with this.inherited
http://stackoverflow.com/questions/10793739/call-grandparent-method-in-dojo-with-this-inherited
JavaScript
dojo.declare("GrandParent", null, {
display: 'grandParent',
logSomething: function(msg) {
console.log('logging: ' + this.display + ' -> ' + msg);
}
});
dojo.declare("Parent", [GrandParent], {
display: 'parent',
logSomething: function(msg) {
throw 'prevent from logging';
}
});
dojo.declare("Child", [Parent], {
display: 'child',
logSomething: function(msg) {
GrandParent.prototype.logSomething(msg);
GrandParent.prototype.logSomething.apply(this, arguments);
}
});
dojo.addOnLoad(function() {
var c = new Child();
c.logSomething('myMsg');
});