Created
December 15, 2011 16:28
-
-
Save iskugor/1481727 to your computer and use it in GitHub Desktop.
This file contains 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
var win = Ti.UI.createWindow({ | |
backgroundColor: '#39f' | |
}); | |
var tableView = Ti.UI.createTableView({ | |
data: [{ title: 'Row 1' }, { title: 'Row 2' }] | |
}); | |
tableView.addEventListener('click', function(e) { | |
var row = e.row; | |
Ti.API.debug(row); | |
Ti.API.debug(row.title); | |
var modalWin = Ti.UI.createWindow({ | |
modal: true, | |
backgroundColor: '#3f9', | |
layout: 'vertical', | |
url: '/test.js' | |
}); | |
modalWin.addEventListener('updateRow', function() { | |
row.backgroundColor = '#fff'; | |
}); | |
modalWin.open(); | |
}); | |
win.add(tableView); | |
win.open(); |
This file contains 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
var modalWin = Ti.UI.currentWindow; | |
var textField = Ti.UI.createTextField({ | |
width: 300 | |
}); | |
var saveButton = Ti.UI.createButton({ title: 'Save' }); | |
modalWin.add(textField); | |
modalWin.add(saveButton); | |
saveButton.addEventListener('click', function() { | |
modalWin.fireEvent('updateRow'); | |
modalWin.close(); | |
modalWin = null; | |
textField = null; | |
row = null; | |
saveButton = null; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment