Commit 7ff7ea10 authored by Frank Bergmann's avatar Frank Bergmann

- Sencha Touch:

  working on NoteDetail
parent a09def23
Ext.define('PO.controller.NoteNavigationController', {
extend: 'Ext.app.Controller',
xtype: 'noteNavigationController',
config: {
refs: {
noteNavigationView: 'noteNavigationView'
},
control: {
'noteList': {
disclose: 'showDetail'
}
}
},
showDetail: function(list, record) {
console.log('disclose details');
var view = this.getNoteNavigationView();
view.push({
xtype: 'noteDetail',
title: record.data.note,
data: record.data
});
}
});
Ext.define('PO.view.ContactPage', {
extend: 'Ext.form.Panel',
xtype: 'contactPage',
config: {
title: 'Contact',
iconCls: 'user',
// xtype: 'formpanel',
id: 'contactFormPanel',
url: 'http://www.project-open.net/intranet-crm-tracking/contact',
layout: 'vbox',
items: [{
xtype: 'fieldset',
title: 'Contact Us',
instructions: '(email address is optional)',
items: [{
xtype: 'textfield',
name: 'first_names',
label: 'Name'
}, {
xtype: 'emailfield',
name: 'email',
label: 'Email'
}, {
xtype: 'textareafield',
name: 'message',
label: 'Message'
}
]
}, {
xtype: 'button',
text: 'Send',
ui: 'confirm',
handler: function() {
// var form = Ext.getCmp('contactFormPanel').getValues();
var form = this.up('formpanel');
form.submit({
method: 'GET',
url: 'http://www.project-open.net/intranet-crm-tracking/contact',
success: function() {
alert('form submitted successfully!');
},
failure: function() {
alert('form submission failed');
}
});
}
}
]
}
});
Ext.define('PO.view.NoteDetail', {
extend: 'Ext.form.Panel',
xtype: 'noteDetail',
config: {
title: 'Note Detail',
layout: 'vbox',
items: [{
xtype: 'fieldset',
title: 'Note Fields',
instructions: '(email address is optional)',
items: [{
xtype: 'textfield',
name: 'first_names',
label: 'Name'
}, {
xtype: 'emailfield',
name: 'email',
label: 'Email'
}, {
xtype: 'textareafield',
name: 'message',
label: 'Message'
}
]
}, {
xtype: 'button',
text: 'Save',
ui: 'confirm',
handler: function() {
// var form = Ext.getCmp('contactFormPanel').getValues();
var form = this.up('formpanel');
form.submit({
method: 'GET',
url: 'http://www.project-open.net/intranet-crm-tracking/contact',
success: function() {
alert('form submitted successfully!');
},
failure: function() {
alert('form submission failed');
}
});
}
}
]
}
});
Ext.define('PO.view.NoteNavigationView', {
extend: 'Ext.navigation.View',
xtype: 'noteNavigationView',
requires: [
'PO.view.NoteList',
'PO.view.NoteDetail'
],
config: {
title: 'Notes',
iconCls: 'star',
items: [{
xtype: 'noteList'
}]
}
});
Ext.define('PO.view.SplashPage', {
extend: 'Ext.Panel',
xtype: 'splashPage',
config: {
title: 'Home',
iconCls: 'home',
scrollable: 'vertical',
// styleHtmlContent: true,
html: [
'<center><img src="/senchatouch-notes/resources/startup/320x460.png"/></center>',
'<h1>]project-open[ Sencha Touch Notes</h1>',
"<p>This demo shows how to build Sencha Touch applications using ]po[."
].join("")
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment