Skip to content

Instantly share code, notes, and snippets.

@k33g
Created October 12, 2011 04:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k33g/1280319 to your computer and use it in GitHub Desktop.
Save k33g/1280319 to your computer and use it in GitHub Desktop.
Coffeescript version of "Getting Started with Sencha Touch 2"
# see http://docs.sencha.com/touch/2-0/#!/guide/getting_started
class TabPanel extends Ext.TabPanel
constructor:->
super
fullscreen : true
tabBarPosition: 'bottom'
items : [
{
title : 'Home'
iconCls : 'home'
cls : 'home'
html :
'
<img src="http://staging.sencha.com/img/sencha.png"/>
<h1>Welcome to Sencha Touch</h1>
to use tabs, lists and forms to create a simple app</p>
<h2>Sencha Touch (2.0.0pr1)</h2>
'
}
{
xtype : 'list'
title : 'blog'
iconCls : 'star'
itemTpl : '{title}'
store :
fields : ['title', 'url']
data : [
{title: 'Ext Scheduler 2.0', url: 'ext-scheduler-2-0-upgrading-to-ext-js-4'}
{title: 'Previewing Sencha Touch 2', url: 'sencha-touch-2-what-to-expect'}
{title: 'Sencha Con 2011', url: 'senchacon-2011-now-packed-with-more-goodness'}
{title: 'Documentation in Ext JS 4', url: 'new-ext-js-4-documentation-center'}
]
}
]
@setActiveItem 1
class Application extends Ext.application
constructor:(name)->
super
name : name
launch : ->
new TabPanel()
MyApp = new Application "Sencha"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment