This file contains hidden or 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
{ | |
Colors: { | |
someColor: '#333', | |
otherColor: '#777' | |
}, | |
someFunction: function(string) { | |
alert(string); | |
} | |
} |
This file contains hidden or 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 searchbar = Ti.UI.createSearchBar({ | |
showCancel: true, | |
barColor: '#7CA122' | |
}); | |
Ajax.xhr('GET', '', 'http://localhost/colors.json', function(data) { | |
searchbar.barColor = data.Colors.someColor; | |
win.barColor = data.Colors.otherColor; | |
data.someFunction(win.title); |
This file contains hidden or 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; | |
win.hideNavBar(); | |
// The main background image | |
var wrapper = Ti.UI.createImageView({ | |
url: 'images/building.png', | |
left: -40 | |
}); | |
win.add(wrapper); |
This file contains hidden or 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
Ti.include( 'includes/tiframework.js' ); | |
var $ = TiFramework; | |
var main_window = $('currentWin'); | |
main_window.focus(function() { | |
// Create the label | |
var label = $('label') | |
// Set some options |
This file contains hidden or 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 = $('currentWin'); | |
$.ajax({ | |
timeout: 3000, | |
type: 'GET', | |
url: 'http://search.twitter.com/search.json?q=from:appcelerator', | |
callback: function(data) { | |
// Create a tableView and append it to current window | |
var customTableView = $('table').appendTo(win); |
This file contains hidden or 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
(function() { | |
var options = { string: 'Default String' }; | |
TiFramework.extend('test', function(string) { | |
if (string == undefined) { | |
alert(options.string); | |
} else { | |
alert(string); | |
} | |
}); |
This file contains hidden or 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 tableview = Titanium.UI.createTableView({ | |
data: rows, | |
top: 10, | |
left: 10, | |
right: 10, | |
borderColor: '#ccc', | |
layout:'vertical' | |
}); | |
// set filters |
This file contains hidden or 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 rows = [ | |
{ title: 'Sample Title Here' } | |
]; | |
var tableview = Ti.UI.createTableView({ data: rows }); | |
win.add(tableview); | |
tableview.addEventListener('click', function() { |
This file contains hidden or 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 rows = [ | |
{ title: 'Sample Title Here' } | |
]; | |
var tableview = Ti.UI.createTableView({ data: rows }); | |
win.add(tableview); | |
tableview.addEventListener('click', function() { |
This file contains hidden or 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
// | |
// Controller File | |
// | |
/** Include the framework **/ | |
Ti.include('includes/tiframework.js'); | |
var $ = TiFramework; | |
// Pull in a few files | |
Ti.include('includes/styles.js', 'includes/views.js'); |