Skip to content

Instantly share code, notes, and snippets.

@iskugor
Created December 15, 2011 16:28
Show Gist options
  • Save iskugor/1481727 to your computer and use it in GitHub Desktop.
Save iskugor/1481727 to your computer and use it in GitHub Desktop.
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();
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