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
// implement like this: | |
var window = Ti.UI.createWindow({ | |
backgroundColor:'#fff' | |
}); | |
// draw the gridlines first so your other elements stack on top of them | |
// without requiring you to set the z-index property of each | |
var grid = require('gridlines'); | |
grid.drawgrid(10,window); |
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
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Learning About Backbone.js Routers</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="http://documentcloud.github.com/underscore/underscore-min.js"></script> |
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 myRouter = Backbone.Router.extend({ | |
routes: { | |
":foo": "func1", | |
":foo/:bar" : "func2", | |
"*action" : "funcU" | |
}, | |
func1: function(p1) { | |
alert('func1: '+p1); | |
console.log('func1: '+p1); | |
}, |
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
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Learning About Backbone.js Views</title> | |
<style type="text/css"> | |
#container{ padding:20px; border:1px solid #333; width:400px; } | |
#list-template{ display:none; } | |
</style> | |
</head> |
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
myModel = new Backbone.Model({ | |
data:[ | |
{ text: "Google", href: "http://google.com" }, | |
{ text: "Facebook", href: "http://facebook.com" }, | |
{ text: "Youtube", href: "http://youtube.com" } | |
] | |
}); |
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 myView = Backbone.View.extend({ | |
initialize: function () { | |
console.log('create view'); | |
}, | |
el: '#container', | |
events: { | |
"click button": "render" | |
}, | |
template: $('#list-template').children(), | |
render: function() { |
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
events: { | |
"click": "render" | |
}, |
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
<li><a href=""></a></li> |
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 view = new myView({ model: myModel }); |
OlderNewer