Dojo aspect inheritance -


i'm having trouble dojo aspect , how behaves inheritance.

i have class called child1 , class called child2. both classes inherit parent.

child1:

return declare("child1", [parent], ... 

child2:

return declare("child2", [parent], ... 

the implementation of child1 , child2 different. parent has method child1 needs aspect to:

this.own(aspect.before(this, "_onchange", lang.hitch(this, "_onrowselected"), true)); 

everything works fine child2 until child1 called. @ point whenever _onchange method called parent, function child1._onrowselected run.... regardless of call originated from.

i think aspect involve object created aspect call in child1, , wouldn't affect child2 whatsoever.

the thing can think of, looks instantiation of child1 , child2 done within html template.

if use inheritance, why use aspect ? not necessary in such case.

in child1, create method _onchange this:

_onchange: function() {     this._onrowselected();     this.inherited(arguments); } 

it achieve same no need of aspect


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -