Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ti.UI.setBackgroundColor('#000');
- var db = Ti.Database.install("cpi.sqlite", "cpi");
- var result = db.execute("SELECT year FROM cpi_index");
- var years = [];
- var counter = 0;
- do
- {
- years[counter] = Ti.UI.createTableViewRow({title: result.field("year").toString()});
- counter++;
- }
- while (result.next());
- var win1 = Ti.UI.createWindow
- ({
- title:'Tab 1',
- backgroundColor:'#fff'
- });
- result.close();
- var tablesView = Ti.UI.createView
- ({
- left: 10,
- width: 400,
- height: 400
- });
- var tablePastLabel = Ti.UI.createLabel
- ({
- text: "Select past date",
- left: 10,
- bottom: 300
- });
- var testLabel = Ti.UI.createLabel
- ({
- text: "",
- left: 150,
- bottom: 350
- });
- var tableFutureLabel = Ti.UI.createLabel
- ({
- text: "Select future date",
- left: 200,
- bottom: 300
- });
- var tablePast = Ti.UI.createTableView
- ({
- allowsSelection: true,
- data: years,
- style: Ti.UI.iPhone.TableViewStyle.GROUPED,
- separatorColor: "red",
- left: 10,
- width: 100,
- height: 250,
- borderColor: "blue"
- });
- var tableFuture = Ti.UI.createTableView
- ({
- allowsSelection: true,
- data: years,
- style: Ti.UI.iPhone.TableViewStyle.GROUPED,
- separatorColor: "red",
- left: 200,
- width: 100,
- height: 250,
- borderColor: "blue"
- });
- tablesView.add(testLabel);
- tablesView.add(tableFutureLabel);
- tablesView.add(tablePastLabel);
- tablesView.add(tablePast);
- tablesView.add(tableFuture);
- /*******************************************************************/
- tablePast.addEventListener('click', function(e)
- {
- tablePastLabel.text = "TEST";
- });
- /******************************************************************/
- win1.add(tablesView);
- win1.open();
Add Comment
Please, Sign In to add comment