Skip to content

Instantly share code, notes, and snippets.

@kenhkan
Created September 14, 2012 21:57
Show Gist options
  • Save kenhkan/3725166 to your computer and use it in GitHub Desktop.
Save kenhkan/3725166 to your computer and use it in GitHub Desktop.
How to access a non-child controller?
$.a.addEventListener("click", function(e) {
// What goes here?
});
".container": {
backgroundColor: "red",
height: "50%"
}
<Alloy>
<View class="container" id="a">
</View>
</Alloy>
$.b.addEventListener("click", function(e) {
$.b.hide();
});
".container": {
backgroundColor: "blue",
height: "50%"
}
<Alloy>
<View class="container" id="b">
</View>
</Alloy>
".container": {
backgroundColor:"white",
layout: "vertical"
}
<Alloy>
<Window class="container">
<Require src="a" id="a"/>
<Require src="b" id="b"/>
</Window>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment