You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//parent page Html
<div data-bind="module: moduleInfo"></div>
//parent view model
this.moduleInfo=ko.observable(
{ data: "",
disposeMethod: "dispose",
id: "moduleId",
initializer: "initialize",
name: "modulevm",
template: "moduleTmpl"
}
);
//module's view model - modulevm
//function that handles a button click event
this.ButtonClick=new function(){
//Do some work.
//How do I let parent know of this event?
}
Is there a recommended way of doing this? Any thoughts / suggestions?
The text was updated successfully, but these errors were encountered:
this.ButtonClick=function(data,event){parent=ko.contextFor(event.target).$parent;// or get the rootroot=ko.contextFor(event.target).$root;alert(root.name);
Thanks. I think this will work. I am using KO Lite async command to wire up events to the view model. I am trying to figure out how I can make the recommendation work with async commands.
Hi Ryan,
Quick question.Here's my setup again-
Is there a recommended way of doing this? Any thoughts / suggestions?
The text was updated successfully, but these errors were encountered: