Created
February 14, 2012 09:13
-
-
Save minhnc/1825022 to your computer and use it in GitHub Desktop.
win1.js
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.currentWindow; | |
var tf1 = Titanium.UI.createTextField({ | |
color : '#336699', | |
height : 35, | |
top : 100, | |
// left : 100, | |
width : 250, | |
// top : 300, --- | |
borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED | |
}); | |
win.add(tf1); | |
var button = Titanium.UI.createButton({ | |
title : 'Save', | |
top : 200, | |
width : 100, | |
height : 50 | |
}); | |
win.add(button); | |
button.addEventListener('click', function() { | |
var db = Titanium.Database.open('doctor_names'); | |
db.execute('CREATE TABLE IF NOT EXISTS doctor (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT)'); | |
db.execute('INSERT INTO doctor (name) VALUES(?)', button.value); | |
db.close(); | |
Titanium.App.fireEvent('app:clicked'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment