Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // populate category array from database
- // only called on first rendering of the tab, after that the array is filled
- if (categoryArray.length == 0) {
- var db = Titanium.Database.open('contentDB');
- var dbrows = db.execute('select category_id, category_name from categories order by category_name asc');
- while (dbrows.isValidRow()) {
- categoryArray.push({
- catid:dbrows.fieldByName('category_id'),
- title:dbrows.fieldByName('category_name')
- });
- Ti.API.info("Found category: "+dbrows.fieldByName('category_name')+" ["+dbrows.fieldByName('category_id')+"]");
- dbrows.next();
- }
- dbrows.close();
- db.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement