What I am trying to do is create a set of buttons for each row found in my SQLite database. I am testing this on the iPad simulator. Using titanium SDK 2.1.4
Here is what I have:
var currentWin = Ti.UI.currentWindow;
var db = Ti.Database.install('../databasename.sqlite', 'table'); //Install SQLite Database
var rows = db.execute('SELECT DISTINCT row FROM table');
var brandView = Ti.UI.createView({ //Primary view for buttons
title: 'Hello',
width: '100%',
height: '100%'
});
currentWin.add(brandView);
for(var j = 0; j < rows.length; j++) { //Pull DB Info
var buttonCount = new Array(rows.length); //Create Button names
for(var i = 0; i < buttonCount.length; i++) {
buttonCount[i] = Ti.UI.createButton({
title: rows[j].name,
width: 100,
height: 100
});
brandView.add(buttonCount[i]);
}
}
It loads without any error, and loads the window, and the view I am calling but no buttons. How can I create a group of buttons based on the retrieved database info?