1. Jay Garcia, CTO & Co-Founder, Modus Create
@ModusJesus
jay@moduscreate.com
Sencha Touch
Custom Components
Monday, July 22, 13
2. Agenda
• Discuss the creation of custom Touch components
• Explore some of the tricks of the trade
• Look at some code that enables custom UI
Monday, July 22, 13
3. About Me
• CTO & Co-Founder Modus Create
• Started with Touch in 2009
• Author of
- Ext JS in Action (3.0 & 4.0)
- Sencha Touch in Action
• Sencha Community supporter
since 2006
Monday, July 22, 13
6. Custom Functionality!
• Requires us to put our thinking caps on
- Write our own DOM renderers
- Custom styles created
- DOM listeners must be applied
- Interactions must be hand-coded
- House cleaning is up to you!
Monday, July 22, 13
7. Swipe a list item to reveal actions underneath
Monday, July 22, 13
10. What do I need to know
to create custom
components?
Monday, July 22, 13
11. What you need to know
• HTML5 semantics
• CSS3
• SASS, Compass
• Touch component lifecycle basics
• Touch Class System
- Config system
- Extending
- Overriding
- Build process
Monday, July 22, 13
63. App details
• Mashup of Rotten Tomatoes &
YouTube APIs
- Uses a custom proxy for data
retention
- Silk JS & Redis
• Recreates the feel of the Netflix
mobile application
Monday, July 22, 13
64. Problem
• All trailer images download at the
same time
• SLOW on 3G!
- Could incur data usage for users
unnecessarily
• How do we fix this?
Monday, July 22, 13
65. Solution
• Custom extension to Container
• Listens to scroller scroll event
- Loads images when they need to be
Monday, July 22, 13
77. How this app works
LibBass
C++
LibBass
C++
Cordova Plugin
ObjectiveC
Cordova
Sencha Touch
Monday, July 22, 13
78. How this app works
LibBass
C++
LibBass
C++
Cordova Plugin
ObjectiveC
Cordova
Sencha Touch
• Directory contents
• Load a song
• Play a song
• Get song FFT data
Monday, July 22, 13
79. How this app works
LibBass
C++
LibBass
C++
Cordova Plugin
ObjectiveC
Cordova
Sencha Touch
• Directory contents
• Load a song
• Play a song
• Get song FFT data
20ms
Monday, July 22, 13
91. More about custom components
Friday 11:30AM
Room E2
Monday, July 22, 13
92. Wrapping up
• Think speed
• Light DOM
• Optimized JavaScript
• Write your own event handlers
• Clean up after yourself!
• Remove unnecessary event handlers
• Remove DOM when not needed
Monday, July 22, 13
93. Take the Survey!
• Session Survey
- Available on the SenchaCon
mobile app
- http://app.senchacon.com
• Be Social!
- @SenchaCon
- #SenchaCon
- @ModusJesus
- @ModusCreate
Monday, July 22, 13