Sure:
app/Index.html
Code:
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<link rel="stylesheet" href="resources/css/myapp.css">
<link rel="stylesheet" href="resources/css/myapp-custom.css">
<script src="lib/sencha-touch-debug.js"></script>
<script src="app/app.js"></script>
<script src="app/view/Start.js"></script>
<script src="app/view/Bits.js"></script>
</head>
<body></body>
</html>
app/app.js:
Code:
// New
//------------------------------------------------------------
Ext.define('MyApp.view.NewIncident', {
extend: 'Ext.form.FormPanel',
xtype: 'incident',
config: {
layout: {
type: 'vbox',
align: 'stretch',
pack: 'center'
},
items: [{
xtype: 'textfield',
name: 'CaseID',
placeHolder: 'Incident Number'
},{
xtype: 'button',
name: 'Begin',
ui: 'Confirm',
text: 'Begin',
handler: function(button, event) {
// MyApp.Viewport.setActiveItem('Dashboard', {type: 'fade'});
}
}],
dockedItems: [{
xtype: 'toolbar',
cls: 'Secondary',
dock: 'bottom',
items: [{
xtype: 'button',
text: 'Cancel',
handler: function() {
// MyApp.Viewport.setActiveItem('Start', {type: 'slide', direction: 'down'});
}
}]
}],
listeners: {
activate: function() {
ToolbarGlobal.setTitle('New Incident');
}
}
}
});
Ext.application({
tabletStartupScreen: 'core-tablet.png',
phoneStartupScreen: 'core-phone.png',
icon: 'core-icon.png',
name: 'MyApp',
views: ['Start', 'NewIncident'],
launch: function() {
Ext.create('MyApp.view.Start');
}
});
app/view/Start.js
Code:
Ext.define('MyApp.view.Start', {
extend: 'Ext.Container',
requires: ['MyApp.view.NewIncident'],
config: {
id: 'Start',
cls: 'Start',
fullscreen: true,
layout: {
type: 'vbox',
pack: 'stretch',
align: 'center',
},
defaults: {
flex: 1
},
items: [{
xtype: 'panel',
layout: {
type: 'vbox',
pack: 'top'
},
items: [{
xtype: 'button',
cls: 'PadTop',
ui: 'Confirm',
text: 'Create New Incident',
handler: function(button, event) {
var myNewIncident = Ext.create({
xtype: 'incident',
id: 'Incident_New'
});
MyApp.Viewport.add(myNewIncident);
MyApp.Viewport.setActiveItem(myNewIncident);
MyApp.Viewport.animateActiveItem(myNewIncident, {type: 'slide', direction: 'up'});
}
}]
},{
xtype: 'panel',
flex: '1',
layout: {
type: 'vbox',
pack: 'bottom'
},
items: [{
xtype: 'button',
cls: 'PadBot',
ui: 'Minor',
text: 'Edit Existing Incident',
handler: function(button, event) {
MyApp.Viewport.setActiveItem('Incident_Edit', {type: 'slide', direction: 'up'});
}
}]
},{
xtype: 'toolbar',
docked: 'top',
items: [{
//iconCls: 'settings6',
icon: 'resources/themes/images/myapp/icon-settings.png',
ui: 'Default',
handler: function() {
MyApp.Viewport.setActiveItem('Settings', {type: 'flip'});
}
},{
xtype: 'spacer'
},{
//iconCls: 'info',
icon: 'resources/themes/images/myapp/icon-info.png',
ui: 'Default',
handler: function() {
MyApp.Viewport.setActiveItem('Info', {type: 'flip'});
//var this_view = this.getId();
//console.log(this_view);
}
}]
}]
}
});
// INTRO
//------------------------------------------------------------
Ext.define('MyApp.view.Intro', {
extend: 'Ext.Panel',
config: {
id: 'Intro',
layout: {
type: 'vbox',
align: 'center',
pack: 'center'
},
items: [{
html: [
'<p>Welcome! Before you can get started you must.....</p>'
]
},{
xtype: 'button',
ui: 'Default',
cls: 'PadTop',
text: 'Go to Settings',
handler: function() {
MyApp.Viewport.setActiveItem('Settings', {type: 'flip'});
}
}]
}
});
// FIRST-TIME RUN
//------------------------------------------------------------
Ext.define('MyApp.view.DetectFirst', {
extend: 'Ext.Panel',
config: {
id: 'DetectFirst',
layout: 'card',
items: ['MyApp.view.Start', 'MyApp.view.Intro'],
listeners: {
activate: function() {
ToolbarGlobal.hide();
}
}
}
});
app/view/Bits.js
Code:
// GENERAL
var setTitle = function(target,title) {
target.dockedItems.items[0].setTitle(title);
}
// TOOLBARS
Ext.define('ToolbarGlobal',{
extend: 'Ext.Toolbar',
config: {
xtype: 'toolbar',
items: [{
//iconCls: 'settings6',
icon: 'resources/themes/images/myapp/icon-settings.png',
ui: 'Default',
handler: function() {
MyApp.Viewport.setActiveItem('Settings', {type: 'flip'});
}
},{
xtype: 'spacer'
},{
//iconCls: 'info',
icon: 'resources/themes/images/myapp/icon-info.png',
ui: 'Default',
handler: function() {
MyApp.Viewport.setActiveItem('Info', {type: 'flip'});
//var this_view = this.getId();
//console.log(this_view);
}
}]
}
});
NewIncident.js
Code:
// The code pasted above the Ext.application in my app.js was right here
//
//
// Edit
//------------------------------------------------------------
Ext.define('EditIncident', {
extend: 'Ext.TabPanel',
config: {
id: 'Incident_Edit',
layout: {
type: 'vbox',
align: 'stretch'
},
ui: 'Filters',
defaults: {
flex: 1,
itemTpl: '{date} ({number})',
},
items: [{
xtype: 'list',
title: 'By Date',
store: IncidentsDate,
itemTpl: '{date} ({number})',
listeners: {
itemtap: function() {
// MyApp.Viewport.setActiveItem('Dashboard', {type: 'slide', direction: 'left'});
}
}
},{
xtype: 'list',
title: 'Incident Number',
store: IncidentsID,
itemTpl: '{number} ({date})',
listeners: {
itemtap: function() {
// MyApp.Viewport.setActiveItem('Dashboard', {type: 'slide', direction: 'left'});
}
}
//onItemDisclosure: function(record, btn, index) {
// MyApp.Viewport.setActiveItem('Dashboard', {type: 'slide', direction: 'left'});
//}
}],
dockedItems: [{
xtype: 'toolbar',
cls: 'Secondary',
dock: 'bottom',
items: [{
xtype: 'button',
text: 'Cancel',
handler: function() {
// MyApp.Viewport.setActiveItem('Start', {type: 'slide', direction: 'down'});
}
}]
}],
listeners: {
activate: function() {
ToolbarGlobal.setTitle('Edit Incident');
}
}
}
});
I think that's everything, but if I have missed anything, let me know.