-
-
Save hugolpz/38832f1691fc3fdead50 to your computer and use it in GitHub Desktop.
Open a child window on Alloy/Titanium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.child_window.open(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<Window id="child_window"> | |
<Label>This is the Child Window</Label> | |
</Window> | |
</Alloy> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.button.addEventListener('click', function(e) { | |
child_window = Alloy.createController('child_window'); | |
// Since the controller calls the open() function, nothing | |
// else is needed here | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<Window id="parent_window"> | |
<Button id="button">Open Child Window</Button> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
parent.xml:
<Button onClick="button">Open Child Window</Button>
parent.js
function button(e) { child_window = Alloy.createController('child_window'); // Since the controller calls the open() function, nothing // else is needed here }