javascript - dojo - object scope for methods in widgets using lang.hitch() -
i have dojo customized widget template shown below
<div> <div class = "btn" data-dojo-attach-point = "buttondiv"></div> <a href="#" data-dojo-attach-point ="adiv">"click me!!"</a> </div>
in js class in postcreate(), attaching click event hyperlink
//inside postcreate function postcreate: function() { this.inherited(arguments); var me = this; me.own(on(me.adiv,"click",lang.hitch(me,me.onclickfun))); }, onclickfun: function (evt,me) { // here not widget object but, hyperlink node. }
as per above code sample, within onclickfun, "this" object pointing tag, created in template. there way, can handle widget object ?? doing wrong here?
thanks !
javascript javascript-events dojo scope widget
No comments:
Post a Comment