I have a $w.Button “myBtn” for example to “create a new record”. I want to hook up a function to its click event. However my function is inside a class object e.g. myObj.new_click() and the function needs access to the object’s members/functions such as name of dataset etc.
myBtn.onClick(myObj.on_click);
However because it does not have context of the myObj, the code inside the myObj.on_click() would not be able to access myObj’s member functions etc.
So if I could hook up myObj with myBtn as some kind of app specific data (e.g. appData) … the event handler could get it back from event.target.appData and then it can access myObj members.