Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Next up, camera

  • Loading branch information...
commit 4ee2681c69198fa654c76d4bda076d3956c21967 1 parent c34f633
Aaron Conran aconran authored
Showing with 1,221 additions and 175 deletions.
  1. +54 −30 NativeContacts.xds
  2. +2 −2 app.html
  3. +56 −9 app.js
  4. +139 −0 app/controller/Contacts.js
  5. +62 −0 app/model/Contact.js
  6. +40 −0 app/store/ContactStore.js
  7. +0 −28 app/view/ContactList.js
  8. +5 −4 app/view/{FavoriteList.js → FavoriteView.js}
  9. +24 −6 app/view/{ContactForm.js → Form.js}
  10. +29 −15 app/view/{contactInfo.js → Info.js}
  11. +48 −0 app/view/List.js
  12. +5 −5 app/view/{MainPanel.js → Main.js}
  13. +3 −4 app/view/{contactPicture.js → Picture.js}
  14. +25 −0 index.html
  15. +54 −8 metadata/Application
  16. +227 −0 metadata/controller/Contacts
  17. +178 −0 metadata/model/Contact
  18. +87 −0 metadata/store/ContactStore
  19. +0 −36 metadata/view/ContactList
  20. +4 −3 metadata/view/{FavoriteList → FavoriteView}
  21. +27 −5 metadata/view/{ContactForm → Form}
  22. +42 −15 metadata/view/{contactInfo → Info}
  23. +88 −0 metadata/view/List
  24. +1 −1  metadata/view/{MainPanel → Main}
  25. +5 −4 metadata/view/{contactPicture → Picture}
  26. BIN  resources/img/defaultContactPic.png
  27. +16 −0 simulator.json
84 NativeContacts.xds
View
@@ -1,12 +1,12 @@
{
"name": "NativeContacts",
"settings": {
- "urlPrefix": "http://localhost/~lucacandela/contacts",
+ "urlPrefix": "http://localhost/NativeContacts/",
"directAPI": "",
"spacesToIndent": 4,
"codeGenFormat": "Class",
- "exportPath": "/Users/lucacandela/Sites/contacts",
- "extPath": "http://extjs.cachefly.net/touch/sencha-touch-2.0.0/",
+ "exportPath": "/Users/aconran/Sites/deploynative",
+ "extPath": "http://localhost/releases/sencha-touch-2.0.0-commercial/",
"senchaIoKey": "",
"senchaIoPath": "http://extjs.cachefly.net/designer/IO/",
"lineEnding": "LF",
@@ -22,58 +22,82 @@
"topInstanceFileMap": {
"ab0ebc18-fc5b-43b1-8958-7395bd191769": {
"paths": [
- "metadata/view/MainPanel",
- "app/view/override/MainPanel.js",
- "app/view/MainPanel.js"
+ "metadata/view/Main",
+ "app/view/override/Main.js",
+ "app/view/Main.js"
],
- "className": "MainPanel"
+ "className": "Main"
},
"266d5780-ee4a-4dca-a156-841cf77894ee": {
"paths": [
- "metadata/view/ContactInfo",
- "app/view/override/ContactInfo.js",
- "app/view/ContactInfo.js"
+ "metadata/view/Info",
+ "app/view/override/Info.js",
+ "app/view/Info.js"
],
- "className": "ContactInfo"
+ "className": "Info"
},
"7187cc37-7c2e-4f8a-a763-ba7d3f34a79c": {
"paths": [
- "metadata/view/ContactForm",
- "app/view/override/ContactForm.js",
- "app/view/ContactForm.js"
+ "metadata/view/Form",
+ "app/view/override/Form.js",
+ "app/view/Form.js"
],
- "className": "ContactForm"
+ "className": "Form"
},
"b037ea3a-5bcd-4f85-930a-abaa1bdc4dcd": {
"paths": [
- "metadata/view/ContactPicture",
- "app/view/override/ContactPicture.js",
- "app/view/ContactPicture.js"
+ "metadata/view/Picture",
+ "app/view/override/Picture.js",
+ "app/view/Picture.js"
],
- "className": "ContactPicture"
+ "className": "Picture"
},
"5b610c64-3053-4d2f-8bfb-77077b9b2217": {
"paths": [
- "metadata/view/ContactList",
- "app/view/override/ContactList.js",
- "app/view/ContactList.js"
+ "metadata/view/List",
+ "app/view/override/List.js",
+ "app/view/List.js"
],
- "className": "ContactList"
+ "className": "List"
},
"e83d8bd0-aa8b-4b79-bf87-9a8797bca19b": {
"paths": [
- "metadata/view/FavoriteList",
- "app/view/override/FavoriteList.js",
- "app/view/FavoriteList.js"
+ "metadata/view/FavoriteView",
+ "app/view/override/FavoriteView.js",
+ "app/view/FavoriteView.js"
],
- "className": "FavoriteList"
+ "className": "FavoriteView"
+ },
+ "8173b689-b7f9-4661-9bb0-6cba367d3d80": {
+ "paths": [
+ "metadata/store/ContactStore",
+ "app/store/override/ContactStore.js",
+ "app/store/ContactStore.js"
+ ],
+ "className": "ContactStore"
+ },
+ "218f2c46-69a4-44c6-8b9e-29b8e3d800dc": {
+ "paths": [
+ "metadata/model/Contact",
+ "app/model/override/Contact.js",
+ "app/model/Contact.js"
+ ],
+ "className": "Contact"
+ },
+ "12f4e105-fe10-4110-a7c7-4be456e0092e": {
+ "paths": [
+ "metadata/controller/Contacts",
+ "app/controller/override/Contacts.js",
+ "app/controller/Contacts.js"
+ ],
+ "className": "Contacts"
}
},
"expandedState": {
- "data": true,
- "model": true,
+ "data": false,
+ "model": false,
"component": true,
- "controller": true,
+ "controller": false,
"resource": true
}
}
4 app.html
View
@@ -6,8 +6,8 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NativeContacts</title>
- <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/touch/sencha-touch-2.0.0/resources/css/sencha-touch.css"/>
- <script type="text/javascript" src="http://extjs.cachefly.net/touch/sencha-touch-2.0.0/sencha-touch-all-debug.js"></script>
+ <link rel="stylesheet" type="text/css" href="http://localhost/releases/sencha-touch-2.0.0-commercial/resources/css/sencha-touch.css"/>
+ <script type="text/javascript" src="http://localhost/releases/sencha-touch-2.0.0-commercial/sencha-touch-all-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript">
if (!Ext.browser.is.WebKit) {
65 app.js
View
@@ -18,19 +18,66 @@ Ext.Loader.setConfig({
});
Ext.application({
+ models: [
+ 'Contact'
+ ],
+ stores: [
+ 'ContactStore'
+ ],
views: [
- 'MainPanel',
- 'ContactInfo',
- 'ContactForm',
- 'ContactPicture',
- 'ContactList',
- 'FavoriteList'
+ 'Main',
+ 'Info',
+ 'Form',
+ 'Picture',
+ 'List',
+ 'FavoriteView'
+ ],
+ name: 'Contact',
+ controllers: [
+ 'Contacts'
],
- name: 'MyApp',
launch: function() {
-
- Ext.create('MyApp.view.MainPanel', {fullscreen: true});
+ Ext.require('Ext.device.*');
+ Ext.util.Format.empty = function(value, defaultValue) {
+ return !Ext.isEmpty(value) ? value : defaultValue;
+ };
+ Ext.util.Format.undef = function(value, defaultValue) {
+ return Ext.isDefined(value) ? value : defaultValue;
+ };
+ var ds = Ext.StoreMgr.lookup('ContactStore');
+ if (!ds.getCount()) {
+ Ext.Msg.alert('Intro', 'Setting up default database.');
+ ds.add({
+ firstName: 'Aaron',
+ lastName: 'Conran',
+ emailAddress: 'aaron@sencha.com',
+ phoneNumber: '443-555-1234'
+ });
+ ds.add({
+ firstName: 'Aditya',
+ lastName: 'Bansod',
+ phoneNumber: '555-555-1234'
+ });
+ ds.add({
+ firstName: 'Luca',
+ lastName: 'Candela',
+ phoneNumber: '555-555-1234'
+ });
+ ds.add({
+ firstName: 'Tommy',
+ lastName: 'Maintz',
+ isFavorite: true,
+ phoneNumber: '717-555-1234'
+ });
+ ds.add({
+ firstName: 'Nige',
+ lastName: '(Animal) White',
+ isFavorite: true,
+ phoneNumber: '555-555-1234'
+ });
+ }
+ Ext.create('Contact.view.Main', {fullscreen: true});
}
});
139 app/controller/Contacts.js
View
@@ -0,0 +1,139 @@
+/*
+ * File: app/controller/Contacts.js
+ *
+ * This file was generated by Sencha Architect version 2.0.0.
+ * http://www.sencha.com/products/architect/
+ *
+ * This file requires use of the Sencha Touch 2.0.x library, under independent license.
+ * License of Sencha Architect does not include license for Sencha Touch 2.0.x. For more
+ * details see http://www.sencha.com/license or contact license@sencha.com.
+ *
+ * This file will be auto-generated each and everytime you save your project.
+ *
+ * Do NOT hand edit this file.
+ */
+
+Ext.define('Contact.controller.Contacts', {
+ extend: 'Ext.app.Controller',
+ config: {
+ stores: [
+ 'ContactStore'
+ ],
+
+ refs: {
+ contactinfo: {
+ selector: 'contactinfo',
+ xtype: 'contactinfo',
+ autoCreate: true
+ },
+ contactform: {
+ selector: 'contactform',
+ xtype: 'contactform',
+ autoCreate: true
+ },
+ contactlist: {
+ selector: 'contactlist',
+ xtype: 'contactlist',
+ autoCreate: true
+ }
+ },
+
+ control: {
+ "button#addContactBtn": {
+ tap: 'onAddContactBtnTap'
+ },
+ "button#saveContactBtn": {
+ tap: 'onSaveContactBtnTap'
+ },
+ "button#editContactBtn": {
+ tap: 'onEditContactBtnTap'
+ },
+ "button#cancelBtn": {
+ tap: 'onCancelBtnTap'
+ },
+ "dataview": {
+ itemtap: 'onContactItemTap'
+ },
+ "button#infoBackBtn": {
+ tap: 'onInfoBackBtnTap'
+ },
+ "favoriteview": {
+ activate: 'onFavoriteViewActivate'
+ },
+ "list": {
+ activate: 'onListActivate'
+ }
+ }
+ },
+
+ onAddContactBtnTap: function(button, e, options) {
+ var referrer = Ext.Viewport.getActiveItem();
+ var form = this.getContactform();
+ form.setRecord(null);
+ form.reset();
+ form.referrer = referrer;
+ Ext.Viewport.setActiveItem(form);
+ },
+
+ onSaveContactBtnTap: function(button, e, options) {
+ var form = this.getContactform();
+ var errors = form.getValidationErrors();
+
+ if (errors.length) {
+ Ext.Msg.alert('Error', errors.join('<br/>'));
+ } else {
+ var values = form.getValues();
+ var record = form.getRecord();
+ if (record) {
+ record.setData(values);
+ record.commit();
+ if (form.referrer.setInfo) {
+ form.referrer.setInfo(record);
+ }
+ } else {
+ Ext.StoreManager.lookup('ContactStore').add(values);
+ }
+ Ext.Viewport.setActiveItem(form.referrer);
+ delete form.referrer;
+ }
+
+ },
+
+ onEditContactBtnTap: function(button, e, options) {
+ var referrer = Ext.Viewport.getActiveItem();
+ var form = this.getContactform();
+ var info = this.getContactinfo();
+ form.referrer = referrer;
+ Ext.Viewport.setActiveItem(form);
+ form.setRecord(info.getRecord());
+ },
+
+ onCancelBtnTap: function(button, e, options) {
+ var form = this.getContactform();
+ Ext.Viewport.setActiveItem(form.referrer);
+ delete form.referrer;
+
+ },
+
+ onContactItemTap: function(dataview, index, target, record, e, options) {
+ var info = this.getContactinfo();
+ info.setInfo(record);
+ Ext.Viewport.setActiveItem(info);
+
+ },
+
+ onInfoBackBtnTap: function(button, e, options) {
+ Ext.Viewport.setActiveItem(0);
+ },
+
+ onFavoriteViewActivate: function(container, newActiveItem, oldActiveItem, options) {
+ var ds = Ext.StoreManager.lookup('ContactStore');
+ ds.filter('isFavorite', true);
+ },
+
+ onListActivate: function(container, newActiveItem, oldActiveItem, options) {
+ var ds = Ext.StoreManager.lookup('ContactStore');
+ ds.clearFilter();
+ }
+
+});
62 app/model/Contact.js
View
@@ -0,0 +1,62 @@
+/*
+ * File: app/model/Contact.js
+ *
+ * This file was generated by Sencha Architect version 2.0.0.
+ * http://www.sencha.com/products/architect/
+ *
+ * This file requires use of the Sencha Touch 2.0.x library, under independent license.
+ * License of Sencha Architect does not include license for Sencha Touch 2.0.x. For more
+ * details see http://www.sencha.com/license or contact license@sencha.com.
+ *
+ * This file will be auto-generated each and everytime you save your project.
+ *
+ * Do NOT hand edit this file.
+ */
+
+Ext.define('Contact.model.Contact', {
+ extend: 'Ext.data.Model',
+ config: {
+ fields: [
+ {
+ name: 'firstName',
+ type: 'string'
+ },
+ {
+ name: 'lastName',
+ type: 'string'
+ },
+ {
+ name: 'phoneNumber',
+ type: 'string'
+ },
+ {
+ name: 'emailAddress',
+ type: 'string'
+ },
+ {
+ name: 'address',
+ type: 'string'
+ },
+ {
+ name: 'city',
+ type: 'string'
+ },
+ {
+ name: 'state',
+ type: 'string'
+ },
+ {
+ name: 'zipcode',
+ type: 'string'
+ },
+ {
+ defaultValue: 'resources/img/defaultContactPic.png',
+ name: 'picture'
+ },
+ {
+ name: 'isFavorite',
+ type: 'boolean'
+ }
+ ]
+ }
+});
40 app/store/ContactStore.js
View
@@ -0,0 +1,40 @@
+/*
+ * File: app/store/ContactStore.js
+ *
+ * This file was generated by Sencha Architect version 2.0.0.
+ * http://www.sencha.com/products/architect/
+ *
+ * This file requires use of the Sencha Touch 2.0.x library, under independent license.
+ * License of Sencha Architect does not include license for Sencha Touch 2.0.x. For more
+ * details see http://www.sencha.com/license or contact license@sencha.com.
+ *
+ * This file will be auto-generated each and everytime you save your project.
+ *
+ * Do NOT hand edit this file.
+ */
+
+Ext.define('Contact.store.ContactStore', {
+ extend: 'Ext.data.Store',
+ requires: [
+ 'Contact.model.Contact'
+ ],
+
+ config: {
+ autoLoad: true,
+ autoSync: true,
+ model: 'Contact.model.Contact',
+ storeId: 'ContactStore',
+ proxy: {
+ type: 'localstorage'
+ },
+ grouper: {
+ groupFn: function(record) {
+ return record.get('firstName')[0];
+
+ }
+ },
+ sorters: {
+ property: 'firstName'
+ }
+ }
+});
28 app/view/ContactList.js
View
@@ -1,28 +0,0 @@
-/*
- * File: app/view/ContactList.js
- *
- * This file was generated by Sencha Architect version 2.0.0.
- * http://www.sencha.com/products/architect/
- *
- * This file requires use of the Sencha Touch 2.0.x library, under independent license.
- * License of Sencha Architect does not include license for Sencha Touch 2.0.x. For more
- * details see http://www.sencha.com/license or contact license@sencha.com.
- *
- * This file will be auto-generated each and everytime you save your project.
- *
- * Do NOT hand edit this file.
- */
-
-Ext.define('MyApp.view.ContactList', {
- extend: 'Ext.dataview.List',
- alias: 'widget.contactlist',
-
- config: {
- grouped: true,
- indexBar: true,
- itemTpl: [
- '<div>List Item {string}</div>'
- ]
- }
-
-});
9 app/view/FavoriteList.js → app/view/FavoriteView.js
View
@@ -1,5 +1,5 @@
/*
- * File: app/view/FavoriteList.js
+ * File: app/view/FavoriteView.js
*
* This file was generated by Sencha Architect version 2.0.0.
* http://www.sencha.com/products/architect/
@@ -13,15 +13,16 @@
* Do NOT hand edit this file.
*/
-Ext.define('MyApp.view.FavoriteList', {
+Ext.define('Contact.view.FavoriteView', {
extend: 'Ext.dataview.DataView',
- alias: 'widget.favoritelist',
+ alias: 'widget.favoriteview',
config: {
scrollable: 'horizontal',
inline: true,
+ store: 'ContactStore',
itemTpl: [
- '<img src="{picture}" /><div>{firstName} {lastName}</div>'
+ '<img src="{picture:empty("resources/img/defaultContactPic.png")}" /><div>{firstName} {lastName}</div>'
]
}
30 app/view/ContactForm.js → app/view/Form.js
View
@@ -1,5 +1,5 @@
/*
- * File: app/view/ContactForm.js
+ * File: app/view/Form.js
*
* This file was generated by Sencha Architect version 2.0.0.
* http://www.sencha.com/products/architect/
@@ -13,14 +13,15 @@
* Do NOT hand edit this file.
*/
-Ext.define('MyApp.view.ContactForm', {
- extend: 'Ext.Container',
+Ext.define('Contact.view.Form', {
+ extend: 'Ext.form.Panel',
+ alias: 'widget.contactform',
requires: [
- 'MyApp.view.ContactPicture'
+ 'Contact.view.Picture'
],
config: {
- id: 'contactInfo',
+ itemId: 'formCancelBtn',
padding: '10px',
scrollable: true,
items: [
@@ -31,6 +32,7 @@ Ext.define('MyApp.view.ContactForm', {
{
xtype: 'button',
id: 'starContact',
+ itemId: 'cancelBtn',
ui: 'decline',
iconMask: true,
text: 'Cancel'
@@ -40,7 +42,7 @@ Ext.define('MyApp.view.ContactForm', {
},
{
xtype: 'button',
- id: 'editContact',
+ itemId: 'saveContactBtn',
ui: 'action',
iconCls: '',
iconMask: true,
@@ -58,6 +60,7 @@ Ext.define('MyApp.view.ContactForm', {
label: 'First Name',
labelAlign: 'top',
name: 'firstName',
+ required: true,
readOnly: false
},
{
@@ -74,6 +77,7 @@ Ext.define('MyApp.view.ContactForm', {
label: 'Phone Number',
labelAlign: 'top',
name: 'phoneNumber',
+ required: true,
readOnly: false
},
{
@@ -120,6 +124,20 @@ Ext.define('MyApp.view.ContactForm', {
readOnly: false
}
]
+ },
+
+ getValidationErrors: function() {
+ var errors = [];
+ var reqFields = this.query('field[required=true]');
+ var i = 0, ln = reqFields.length, field;
+ for (; i < ln; i++) {
+ field = reqFields[i];
+ if (!field.getValue()) {
+ errors.push(field.getLabel() + ' must be completed.');
+ }
+ }
+ console.dir(errors);
+ return errors;
}
});
44 app/view/contactInfo.js → app/view/Info.js
View
@@ -1,5 +1,5 @@
/*
- * File: app/view/ContactInfo.js
+ * File: app/view/Info.js
*
* This file was generated by Sencha Architect version 2.0.0.
* http://www.sencha.com/products/architect/
@@ -13,14 +13,14 @@
* Do NOT hand edit this file.
*/
-Ext.define('MyApp.view.ContactInfo', {
- extend: 'Ext.Container',
+Ext.define('Contact.view.Info', {
+ extend: 'Ext.form.Panel',
+ alias: 'widget.contactinfo',
requires: [
- 'MyApp.view.ContactPicture'
+ 'Contact.view.Picture'
],
config: {
- id: 'contactInfo',
padding: '10px',
items: [
{
@@ -29,25 +29,28 @@ Ext.define('MyApp.view.ContactInfo', {
items: [
{
xtype: 'button',
+ itemId: 'infoBackBtn',
ui: 'back',
text: 'Back'
},
{
xtype: 'component',
html: 'First Name Last Name',
- id: 'nameBack',
- flex: 3
+ itemId: 'nameTxt',
+ flex: 1
},
{
xtype: 'button',
- id: 'starContact',
+ cls: 'x-button-pressing',
+ itemId: 'favoriteBtn',
iconCls: 'favorites',
iconMask: true,
text: ''
},
{
xtype: 'button',
- id: 'editContact',
+ id: '',
+ itemId: 'editContactBtn',
iconCls: 'compose',
iconMask: true,
text: ''
@@ -60,21 +63,22 @@ Ext.define('MyApp.view.ContactInfo', {
{
xtype: 'textfield',
disabled: true,
- itemId: 'emailAddress',
+ itemId: 'phoneNumber',
clearIcon: false,
- label: 'Email Address',
+ label: 'Phone Number',
labelAlign: 'top',
- name: 'emailAddress',
+ name: 'phoneNumber',
readOnly: true
},
{
xtype: 'textfield',
disabled: true,
- itemId: 'phoneNumber',
+ itemId: 'emailAddress',
clearIcon: false,
- label: 'Phone Number',
+ label: 'Email Address',
labelAlign: 'top',
- name: 'phoneNumber',
+ name: 'emailAddress',
+ placeHolder: 'Email address not provided',
readOnly: true
},
{
@@ -85,9 +89,19 @@ Ext.define('MyApp.view.ContactInfo', {
label: 'Address',
labelAlign: 'top',
name: 'address',
+ placeHolder: 'Address not provided',
readOnly: true
}
]
+ },
+
+ setInfo: function(record) {
+ this.setRecord(record);
+ var name = record.get('firstName') + ' ' + (record.get('lastName') || '');
+ var isFavorite = record.get('isFavorite');
+ this.down('#nameTxt').setHtml(name);
+ // this.child('#contactPic').setPic(record.picture);
+ this.down('#favoriteBtn')[isFavorite ? 'addCls' : 'removeCls']('x-button-pressing');
}
});
48 app/view/List.js
View
@@ -0,0 +1,48 @@
+/*
+ * File: app/view/List.js
+ *
+ * This file was generated by Sencha Architect version 2.0.0.
+ * http://www.sencha.com/products/architect/
+ *
+ * This file requires use of the Sencha Touch 2.0.x library, under independent license.
+ * License of Sencha Architect does not include license for Sencha Touch 2.0.x. For more
+ * details see http://www.sencha.com/license or contact license@sencha.com.
+ *
+ * This file will be auto-generated each and everytime you save your project.
+ *
+ * Do NOT hand edit this file.
+ */
+
+Ext.define('Contact.view.List', {
+ extend: 'Ext.dataview.List',
+ alias: 'widget.contactlist',
+
+ config: {
+ store: 'ContactStore',
+ disableSelection: true,
+ grouped: true,
+ indexBar: true,
+ itemTpl: [
+ '<div>{firstName} {lastName}</div>'
+ ],
+ items: [
+ {
+ xtype: 'toolbar',
+ docked: 'top',
+ items: [
+ {
+ xtype: 'spacer'
+ },
+ {
+ xtype: 'button',
+ itemId: 'addContactBtn',
+ ui: 'action',
+ iconCls: 'add',
+ iconMask: true
+ }
+ ]
+ }
+ ]
+ }
+
+});
10 app/view/MainPanel.js → app/view/Main.js
View
@@ -1,5 +1,5 @@
/*
- * File: app/view/MainPanel.js
+ * File: app/view/Main.js
*
* This file was generated by Sencha Architect version 2.0.0.
* http://www.sencha.com/products/architect/
@@ -13,11 +13,11 @@
* Do NOT hand edit this file.
*/
-Ext.define('MyApp.view.MainPanel', {
+Ext.define('Contact.view.Main', {
extend: 'Ext.tab.Panel',
requires: [
- 'MyApp.view.ContactList',
- 'MyApp.view.FavoriteList'
+ 'Contact.view.List',
+ 'Contact.view.FavoriteView'
],
config: {
@@ -35,7 +35,7 @@ Ext.define('MyApp.view.MainPanel', {
title: 'Contacts'
},
{
- xtype: 'favoritelist',
+ xtype: 'favoriteview',
title: 'Favorites'
}
]
7 app/view/contactPicture.js → app/view/Picture.js
View
@@ -1,5 +1,5 @@
/*
- * File: app/view/ContactPicture.js
+ * File: app/view/Picture.js
*
* This file was generated by Sencha Architect version 2.0.0.
* http://www.sencha.com/products/architect/
@@ -13,14 +13,13 @@
* Do NOT hand edit this file.
*/
-Ext.define('MyApp.view.ContactPicture', {
+Ext.define('Contact.view.Picture', {
extend: 'Ext.Container',
alias: 'widget.contactpic',
config: {
height: 120,
html: '<img src="images/contact.jpeg">',
- id: 'contactPicture',
minHeight: 100,
style: 'overflow: hidden',
ui: '',
@@ -37,7 +36,7 @@ Ext.define('MyApp.view.ContactPicture', {
{
xtype: 'button',
bottom: 5,
- id: 'pictureButton',
+ itemId: 'mybutton',
right: 5,
iconCls: 'add',
iconMask: true
25 index.html
View
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+
+<!-- Auto Generated with Sencha Architect -->
+<!-- Modifications to this file will be overwritten. -->
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>NativeContacts</title>
+ <link rel="stylesheet" type="text/css" href="http://localhost/releases/sencha-touch-2.0.0-commercial/resources/css/sencha-touch.css"/>
+ <script type="text/javascript" src="http://localhost/releases/sencha-touch-2.0.0-commercial/sencha-touch-all-debug.js"></script>
+ <script type="text/javascript" src="app.js"></script>
+ <script type="text/javascript">
+ if (!Ext.browser.is.WebKit) {
+ alert("The current browser is unsupported.\n\nSupported browsers:\n" +
+ "Google Chrome\n" +
+ "Apple Safari\n" +
+ "Mobile Safari (iOS)\n" +
+ "Android Browser\n" +
+ "BlackBerry Browser"
+ );
+ }
+ </script>
+</head>
+<body></body>
+</html>
62 metadata/Application
View
@@ -7,19 +7,65 @@
},
"codeClass": null,
"userConfig": {
+ "models": [
+ "Contact"
+ ],
+ "stores": [
+ "ContactStore"
+ ],
"views": [
- "MainPanel",
- "ContactInfo",
- "ContactForm",
- "ContactPicture",
- "ContactList",
- "FavoriteList"
+ "Main",
+ "Info",
+ "Form",
+ "Picture",
+ "List",
+ "FavoriteView"
+ ],
+ "name": "Contact",
+ "controllers": [
+ "Contacts"
],
- "name": "MyApp"
+ "designer|requires": null
},
"customConfigs": [],
"designerId": "application",
"$viewOrder": 0,
"iconCls": "icon-application",
- "expanded": true
+ "expanded": true,
+ "cn": [
+ {
+ "id": "ExtBox1-ext-gen46097",
+ "type": "fixedfunction",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "launch",
+ "implHandler": "Ext.require('Ext.device.*');\nExt.util.Format.empty = function(value, defaultValue) {\n return !Ext.isEmpty(value) ? value : defaultValue;\n};\nExt.util.Format.undef = function(value, defaultValue) {\n return Ext.isDefined(value) ? value : defaultValue;\n};\nvar ds = Ext.StoreMgr.lookup('ContactStore');\nif (!ds.getCount()) {\n Ext.Msg.alert('Intro', 'Setting up default database.');\n ds.add({\n firstName: 'Aaron',\n lastName: 'Conran',\n emailAddress: 'aaron@sencha.com',\n phoneNumber: '443-555-1234'\n });\n ds.add({\n firstName: 'Aditya',\n lastName: 'Bansod',\n phoneNumber: '555-555-1234'\n });\n ds.add({\n firstName: 'Luca',\n lastName: 'Candela',\n phoneNumber: '555-555-1234'\n });\n ds.add({\n firstName: 'Tommy',\n lastName: 'Maintz',\n isFavorite: true,\n phoneNumber: '717-555-1234'\n });\n ds.add({\n firstName: 'Nige',\n lastName: '(Animal) White',\n isFavorite: true,\n phoneNumber: '555-555-1234'\n });\n}",
+ "designer|userClassName": "launch"
+ },
+ "customConfigs": [],
+ "iconCls": "icon-basic-function",
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen74334",
+ "type": "loader",
+ "reference": {
+ "name": "loader",
+ "type": "object"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "enabled": true,
+ "paths": null,
+ "designer|userClassName": "Loader"
+ },
+ "customConfigs": [],
+ "iconCls": "icon-loader",
+ "expanded": true
+ }
+ ]
}
227 metadata/controller/Contacts
View
@@ -0,0 +1,227 @@
+{
+ "id": "ExtBox1-ext-gen24846",
+ "type": "controller",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "stores": [
+ "ContactStore"
+ ],
+ "designer|userClassName": "Contacts"
+ },
+ "customConfigs": [],
+ "designerId": "12f4e105-fe10-4110-a7c7-4be456e0092e",
+ "$viewOrder": 0,
+ "expanded": true,
+ "cn": [
+ {
+ "id": "ExtBox1-ext-gen25027",
+ "type": "controllerref",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "ref": "contactinfo",
+ "selector": "contactinfo",
+ "xtype": "contactinfo",
+ "autoCreate": true,
+ "designer|userClassName": "contactinfo"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen25200",
+ "type": "controllerref",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "ref": "contactform",
+ "selector": "contactform",
+ "xtype": "contactform",
+ "autoCreate": true,
+ "designer|userClassName": "contactform"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen26386",
+ "type": "controllerref",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "ref": "contactlist",
+ "selector": "contactlist",
+ "xtype": "contactlist",
+ "autoCreate": true,
+ "designer|userClassName": "contactlist"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen32770",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onAddContactBtnTap",
+ "implHandler": "var referrer = Ext.Viewport.getActiveItem();\nvar form = this.getContactform();\nform.setRecord(null);\nform.reset();\nform.referrer = referrer;\nExt.Viewport.setActiveItem(form);",
+ "name": "tap",
+ "designer|targetType": "Ext.Button",
+ "designer|controlQuery": "button#addContactBtn",
+ "designer|userClassName": "onAddContactBtnTap"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen34079",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onSaveContactBtnTap",
+ "implHandler": "var form = this.getContactform();\nvar errors = form.getValidationErrors();\n\nif (errors.length) {\n Ext.Msg.alert('Error', errors.join('<br/>'));\n} else {\n var values = form.getValues();\n var record = form.getRecord();\n if (record) {\n record.setData(values);\n record.commit();\n if (form.referrer.setInfo) {\n form.referrer.setInfo(record);\n }\n } else {\n Ext.StoreManager.lookup('ContactStore').add(values);\n }\n Ext.Viewport.setActiveItem(form.referrer);\n delete form.referrer;\n}\n",
+ "name": "tap",
+ "designer|targetType": "Ext.Button",
+ "designer|controlQuery": "button#saveContactBtn",
+ "designer|userClassName": "onSaveContactBtnTap"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen43963",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onEditContactBtnTap",
+ "implHandler": "var referrer = Ext.Viewport.getActiveItem();\nvar form = this.getContactform();\nvar info = this.getContactinfo();\nform.referrer = referrer;\nExt.Viewport.setActiveItem(form);\nform.setRecord(info.getRecord());",
+ "name": "tap",
+ "designer|targetType": "Ext.Button",
+ "designer|controlQuery": "button#editContactBtn",
+ "designer|userClassName": "onEditContactBtnTap"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen47869",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onCancelBtnTap",
+ "implHandler": "var form = this.getContactform();\nExt.Viewport.setActiveItem(form.referrer);\ndelete form.referrer;\n",
+ "name": "tap",
+ "designer|targetType": "Ext.Button",
+ "designer|controlQuery": "button#cancelBtn",
+ "designer|userClassName": "onCancelBtnTap"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen49089",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onContactItemTap",
+ "implHandler": "var info = this.getContactinfo();\ninfo.setInfo(record);\nExt.Viewport.setActiveItem(info);\n",
+ "name": "itemtap",
+ "designer|targetType": "Ext.dataview.DataView",
+ "designer|controlQuery": "dataview",
+ "designer|userClassName": "onContactItemTap"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen52208",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onInfoBackBtnTap",
+ "implHandler": "Ext.Viewport.setActiveItem(0);",
+ "name": "tap",
+ "designer|targetType": "Ext.Button",
+ "designer|controlQuery": "button#infoBackBtn",
+ "designer|userClassName": "onInfoBackBtnTap"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen70386",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onFavoriteViewActivate",
+ "implHandler": "var ds = Ext.StoreManager.lookup('ContactStore');\nds.filter('isFavorite', true);",
+ "name": "activate",
+ "designer|targetType": "Ext.dataview.DataView",
+ "designer|controlQuery": "favoriteview",
+ "designer|userClassName": "onFavoriteViewActivate"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen71213",
+ "type": "controlleraction",
+ "reference": {
+ "name": "listeners",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "onListActivate",
+ "implHandler": "var ds = Ext.StoreManager.lookup('ContactStore');\nds.clearFilter();",
+ "name": "activate",
+ "designer|targetType": "Ext.dataview.List",
+ "designer|controlQuery": "list",
+ "designer|userClassName": "onListActivate"
+ },
+ "customConfigs": [],
+ "expanded": true
+ }
+ ]
+}
178 metadata/model/Contact
View
@@ -0,0 +1,178 @@
+{
+ "id": "ExtBox1-ext-gen17347",
+ "type": "datamodel",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "designer|userClassName": "Contact"
+ },
+ "customConfigs": [],
+ "designerId": "218f2c46-69a4-44c6-8b9e-29b8e3d800dc",
+ "$viewOrder": 0,
+ "expanded": true,
+ "cn": [
+ {
+ "id": "ExtBox1-ext-gen17531",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "firstName",
+ "type": "string",
+ "designer|userClassName": "MyField"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen17688",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "lastName",
+ "type": "string",
+ "designer|userClassName": "MyField1"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen17849",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "phoneNumber",
+ "type": "string",
+ "designer|userClassName": "MyField2"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen18014",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "emailAddress",
+ "type": "string",
+ "designer|userClassName": "MyField3"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen18183",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "address",
+ "type": "string",
+ "designer|userClassName": "MyField4"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen18356",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "city",
+ "type": "string",
+ "designer|userClassName": "MyField5"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen18533",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "state",
+ "type": "string",
+ "designer|userClassName": "MyField6"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen18714",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "zipcode",
+ "type": "string",
+ "designer|userClassName": "MyField7"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen19217",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "defaultValue": "resources/img/defaultContactPic.png",
+ "name": "picture",
+ "designer|userClassName": "MyField8"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen19406",
+ "type": "datafield",
+ "reference": {
+ "name": "fields",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "name": "isFavorite",
+ "type": "boolean",
+ "designer|userClassName": "MyField9"
+ },
+ "customConfigs": [],
+ "expanded": true
+ }
+ ]
+}
87 metadata/store/ContactStore
View
@@ -0,0 +1,87 @@
+{
+ "id": "ExtBox1-ext-gen19686",
+ "type": "store",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "autoLoad": true,
+ "autoSync": true,
+ "model": "Contact",
+ "storeId": "ContactStore",
+ "designer|userClassName": "ContactStore"
+ },
+ "customConfigs": [],
+ "designerId": "8173b689-b7f9-4661-9bb0-6cba367d3d80",
+ "$viewOrder": 0,
+ "expanded": true,
+ "cn": [
+ {
+ "id": "ExtBox1-ext-gen21180",
+ "type": "localstorageproxy",
+ "reference": {
+ "name": "proxy",
+ "type": "object"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "designer|userClassName": "MyLocalStorageProxy"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen31918",
+ "type": "grouper",
+ "reference": {
+ "name": "grouper",
+ "type": "object"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "designer|userClassName": "MyGrouper"
+ },
+ "customConfigs": [],
+ "expanded": true,
+ "cn": [
+ {
+ "id": "ExtBox1-ext-gen32026",
+ "type": "fixedfunction",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "groupFn",
+ "designer|params": [
+ "record"
+ ],
+ "implHandler": "return record.get('firstName')[0];\n",
+ "designer|userClassName": "groupFn"
+ },
+ "customConfigs": [],
+ "iconCls": "icon-basic-function",
+ "expanded": true
+ }
+ ]
+ },
+ {
+ "id": "ExtBox1-ext-gen32431",
+ "type": "sorter",
+ "reference": {
+ "name": "sorters",
+ "type": "object"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "property": "firstName",
+ "designer|userClassName": "MySorter"
+ },
+ "customConfigs": [],
+ "expanded": true
+ }
+ ]
+}
36 metadata/view/ContactList
View
@@ -1,36 +0,0 @@
-{
- "id": "ExtBox1-ext-gen2950",
- "type": "list",
- "reference": {
- "name": "items",
- "type": "array"
- },
- "codeClass": null,
- "userConfig": {
- "itemTpl": "<div>List Item {string}</div>",
- "grouped": true,
- "designer|userClassName": "ContactList",
- "designer|userAlias": "contactlist"
- },
- "customConfigs": [],
- "designerId": "5b610c64-3053-4d2f-8bfb-77077b9b2217",
- "$viewOrder": 4,
- "expanded": true,
- "cn": [
- {
- "id": "ExtBox1-ext-gen3212",
- "type": "listindexbar",
- "reference": {
- "name": "indexBar",
- "type": "object"
- },
- "codeClass": null,
- "userConfig": {
- "letters": null,
- "designer|userClassName": "MyIndexBar"
- },
- "customConfigs": [],
- "expanded": true
- }
- ]
-}
7 metadata/view/FavoriteList → metadata/view/FavoriteView
View
@@ -9,9 +9,10 @@
"userConfig": {
"scrollable": "horizontal",
"inline": "true",
- "itemTpl": "<img src=\"{picture}\" /><div>{firstName} {lastName}</div>",
- "designer|userClassName": "FavoriteList",
- "designer|userAlias": "favoritelist"
+ "itemTpl": "<img src=\"{picture:empty(\"resources/img/defaultContactPic.png\")}\" /><div>{firstName} {lastName}</div>",
+ "store": "ContactStore",
+ "designer|userClassName": "FavoriteView",
+ "designer|userAlias": "favoriteview"
},
"customConfigs": [],
"designerId": "e83d8bd0-aa8b-4b79-bf87-9a8797bca19b",
32 metadata/view/ContactForm → metadata/view/Form
View
@@ -1,16 +1,18 @@
{
"id": "ExtBox1-ext-gen27267",
- "type": "container",
+ "type": "formpanel",
"reference": {
"name": "items",
"type": "array"
},
"codeClass": null,
"userConfig": {
- "id": "contactInfo",
+ "id": null,
+ "itemId": "formCancelBtn",
"padding": "10px",
- "scrollable": true,
- "designer|userClassName": "ContactForm"
+ "scrollable": "true",
+ "designer|userClassName": "Form",
+ "designer|userAlias": "contactform"
},
"customConfigs": [],
"designerId": "7187cc37-7c2e-4f8a-a763-ba7d3f34a79c",
@@ -42,6 +44,7 @@
"codeClass": null,
"userConfig": {
"id": "starContact",
+ "itemId": "cancelBtn",
"ui": "decline",
"iconCls": null,
"iconMask": true,
@@ -74,7 +77,8 @@
},
"codeClass": null,
"userConfig": {
- "id": "editContact",
+ "id": null,
+ "itemId": "saveContactBtn",
"ui": "action",
"iconCls": "",
"iconMask": true,
@@ -114,6 +118,7 @@
"label": "First Name",
"labelAlign": "top",
"name": "firstName",
+ "required": true,
"readOnly": false,
"designer|userClassName": "MyTextField"
},
@@ -152,6 +157,7 @@
"label": "Phone Number",
"labelAlign": "top",
"name": "phoneNumber",
+ "required": true,
"readOnly": false,
"designer|userClassName": "MyTextField1"
},
@@ -255,6 +261,22 @@
},
"customConfigs": [],
"expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen53380",
+ "type": "basicfunction",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "getValidationErrors",
+ "implHandler": "var errors = [];\nvar reqFields = this.query('field[required=true]');\nvar i = 0, ln = reqFields.length, field;\nfor (; i < ln; i++) {\n field = reqFields[i];\n if (!field.getValue()) {\n errors.push(field.getLabel() + ' must be completed.');\n }\n}\nconsole.dir(errors);\nreturn errors;",
+ "designer|userClassName": "getValidationErrors"
+ },
+ "customConfigs": [],
+ "expanded": true
}
]
}
57 metadata/view/contactInfo → metadata/view/Info
View
@@ -1,15 +1,16 @@
{
"id": "ExtBox1-ext-gen6063",
- "type": "container",
+ "type": "formpanel",
"reference": {
"name": "items",
"type": "array"
},
"codeClass": null,
"userConfig": {
- "id": "contactInfo",
+ "id": null,
"padding": "10px",
- "designer|userClassName": "ContactInfo"
+ "designer|userClassName": "Info",
+ "designer|userAlias": "contactinfo"
},
"customConfigs": [],
"designerId": "266d5780-ee4a-4dca-a156-841cf77894ee",
@@ -40,6 +41,7 @@
},
"codeClass": null,
"userConfig": {
+ "itemId": "infoBackBtn",
"ui": "back",
"text": "Back",
"designer|userClassName": "MyButton5"
@@ -58,9 +60,10 @@
"userConfig": {
"height": null,
"html": "First Name Last Name",
- "id": "nameBack",
+ "id": null,
+ "itemId": "nameTxt",
"designer|userClassName": "MyComponent",
- "layout|flex": 3
+ "layout|flex": 1
},
"customConfigs": [],
"expanded": true
@@ -74,7 +77,9 @@
},
"codeClass": null,
"userConfig": {
- "id": "starContact",
+ "cls": "x-button-pressing",
+ "id": null,
+ "itemId": "favoriteBtn",
"iconCls": "favorites",
"iconMask": true,
"text": "",
@@ -92,7 +97,8 @@
},
"codeClass": null,
"userConfig": {
- "id": "editContact",
+ "id": "",
+ "itemId": "editContactBtn",
"iconCls": "compose",
"iconMask": true,
"text": "",
@@ -118,7 +124,7 @@
"masterInstanceId": "ExtBox1-ext-gen15697"
},
{
- "id": "ExtBox1-ext-gen19570",
+ "id": "ExtBox1-ext-gen19671",
"type": "textfield",
"reference": {
"name": "items",
@@ -127,11 +133,11 @@
"codeClass": null,
"userConfig": {
"disabled": true,
- "itemId": "emailAddress",
+ "itemId": "phoneNumber",
"clearIcon": false,
- "label": "Email Address",
+ "label": "Phone Number",
"labelAlign": "top",
- "name": "emailAddress",
+ "name": "phoneNumber",
"readOnly": true,
"designer|userClassName": "MyTextField1"
},
@@ -139,7 +145,7 @@
"expanded": true
},
{
- "id": "ExtBox1-ext-gen19671",
+ "id": "ExtBox1-ext-gen19570",
"type": "textfield",
"reference": {
"name": "items",
@@ -148,11 +154,12 @@
"codeClass": null,
"userConfig": {
"disabled": true,
- "itemId": "phoneNumber",
+ "itemId": "emailAddress",
"clearIcon": false,
- "label": "Phone Number",
+ "label": "Email Address",
"labelAlign": "top",
- "name": "phoneNumber",
+ "name": "emailAddress",
+ "placeHolder": "Email address not provided",
"readOnly": true,
"designer|userClassName": "MyTextField1"
},
@@ -175,11 +182,31 @@
"label": "Address",
"labelAlign": "top",
"name": "address",
+ "placeHolder": "Address not provided",
"readOnly": true,
"designer|userClassName": "MyTextField1"
},
"customConfigs": [],
"expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen63864",
+ "type": "basicfunction",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "fn": "setInfo",
+ "designer|params": [
+ "record"
+ ],
+ "implHandler": "this.setRecord(record);\nvar name = record.get('firstName') + ' ' + (record.get('lastName') || '');\nvar isFavorite = record.get('isFavorite');\nthis.down('#nameTxt').setHtml(name);\n// this.child('#contactPic').setPic(record.picture);\nthis.down('#favoriteBtn')[isFavorite ? 'addCls' : 'removeCls']('x-button-pressing');",
+ "designer|userClassName": "setInfo"
+ },
+ "customConfigs": [],
+ "expanded": true
}
]
}
88 metadata/view/List
View
@@ -0,0 +1,88 @@
+{
+ "id": "ExtBox1-ext-gen2950",
+ "type": "list",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "itemTpl": "<div>{firstName} {lastName}</div>",
+ "store": "ContactStore",
+ "disableSelection": true,
+ "grouped": true,
+ "designer|userClassName": "List",
+ "designer|userAlias": "contactlist"
+ },
+ "customConfigs": [],
+ "designerId": "5b610c64-3053-4d2f-8bfb-77077b9b2217",
+ "$viewOrder": 4,
+ "expanded": false,
+ "cn": [
+ {
+ "id": "ExtBox1-ext-gen3212",
+ "type": "listindexbar",
+ "reference": {
+ "name": "indexBar",
+ "type": "object"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "letters": null,
+ "designer|userClassName": "MyIndexBar"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen22882",
+ "type": "toolbar",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "docked": "top",
+ "designer|userClassName": "MyToolbar2"
+ },
+ "customConfigs": [],
+ "expanded": true,
+ "cn": [
+ {
+ "id": "ExtBox1-ext-gen24559",
+ "type": "spacer",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "designer|userClassName": "MySpacer1"
+ },
+ "customConfigs": [],
+ "expanded": true
+ },
+ {
+ "id": "ExtBox1-ext-gen23068",
+ "type": "button",
+ "reference": {
+ "name": "items",
+ "type": "array"
+ },
+ "codeClass": null,
+ "userConfig": {
+ "itemId": "addContactBtn",
+ "ui": "action",
+ "iconCls": "add",
+ "iconMask": true,
+ "text": null,
+ "designer|userClassName": "MyButton6"
+ },
+ "customConfigs": [],
+ "expanded": true
+ }
+ ]
+ }
+ ]
+}
2  metadata/view/MainPanel → metadata/view/Main
View
@@ -8,7 +8,7 @@
"codeClass": null,
"userConfig": {
"designer|initialView": true,
- "designer|userClassName": "MainPanel"
+ "designer|userClassName": "Main"
},
"customConfigs": [],
"designerId": "ab0ebc18-fc5b-43b1-8958-7395bd191769",
9 metadata/view/contactPicture → metadata/view/Picture
View
@@ -9,7 +9,7 @@
"userConfig": {
"height": 120,
"html": "<img src=\"images/contact.jpeg\">",
- "id": "contactPicture",
+ "id": null,
"minHeight": 100,
"style": "overflow: hidden",
"ui": "",
@@ -17,7 +17,7 @@
"masked": null,
"modal": null,
"scrollable": null,
- "designer|userClassName": "ContactPicture",
+ "designer|userClassName": "Picture",
"designer|userAlias": "contactpic",
"overflow": "hidden",
"container|align": "center"
@@ -31,7 +31,7 @@
],
"designerId": "b037ea3a-5bcd-4f85-930a-abaa1bdc4dcd",
"$viewOrder": 3,
- "expanded": false,
+ "expanded": true,
"cn": [
{
"id": "ExtBox1-ext-gen4635",
@@ -60,7 +60,8 @@
"userConfig": {
"bottom": 5,
"docked": null,
- "id": "pictureButton",
+ "id": null,
+ "itemId": "mybutton",
"right": 5,
"width": null,
"iconCls": "add",
BIN  resources/img/defaultContactPic.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 simulator.json
View
@@ -0,0 +1,16 @@
+{
+ "applicationName": "Contact Example",
+ "applicationId": "com.sencha.contactexample",
+ "bundleSeedId": "",
+ "versionString": "1.0",
+ "iconName": "icon.png",
+ "inputPath": "./",
+ "outputPath": "../build/",
+ "configuration": "Debug",
+ "platform": "iOSSimulator",
+ "deviceType": "Universal",
+ "certificatePath": "/path/to/certificate.file",
+ "certificateAlias": "",
+ "sdkPath": "/path/to/android-sdk",
+ "androidAPILevel": "7"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.