1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
Ext.define('Test_mvc.view.mainView', {
extend: 'Ext.tab.Panel',
config: {
tabBarPosition: 'bottom',
items: [
// This is the home page, just some simple HTML
{
title: 'Home',
iconCls: 'home',
cls: 'home',
html: [
'<img height=260 src="images/astrium.png" />',
'<h1 style="margin-left:30%;eight:5%;">Welcome to Satellite Control Center portail</h1>',
"<p></p>",
'<h2></h2>'
].join("")
},
// This is the recent blogs page. It uses a tree store to load its data from blog.json.
{
xtype: 'nestedlist',
title: 'Blog',
iconCls: 'star',
cls: 'blog',
displayField: 'title',
store: {
type: 'tree',
fields: ['title', 'link', 'author', 'contentSnippet', 'content', {
name: 'leaf',
defaultValue: true
}],
root: {
leaf: false
},
proxy: {
type: 'jsonp',
url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://feeds.feedburner.com/SenchaBlog',
reader: {
type: 'json',
rootProperty: 'responseData.feed.entries'
}
}
},
detailCard: {
xtype: 'panel',
scrollable: true,
styleHtmlContent: true
},
listeners: {
itemtap: function(nestedList, list, index, element, post) {
this.getDetailCard().setHtml(post.get('content'));
}
}
},
// This is the contact page, which features a form and a button. The button submits the form.
{
xtype: 'formpanel',
title: 'connexion',
iconCls: 'user',
url: 'contact.php',
layout: 'vbox',
items: [
{
xtype: 'fieldset',
title: 'CCS Authentification',
instructions: 'Email address is optional',
height: 285,
items: [
{
xtype: 'textfield',
label: 'Name',
name: 'name',
id:'myname'
},
{
xtype: 'emailfield',
label: 'Email',
name: 'email',
},
{
xtype: 'textareafield',
label: 'Message',
name: 'message',
height: 90
}
]
},
{
xtype: 'button',
text: 'Connexion',
ui: 'confirm',
id:'monButton',
// The handler is called when the button is tapped
handler: function() {
alert('yesss');
// Look up the items stack and get a reference to the first form it finds
var form = this.up('formpanel');
// var champsNom=Ext.getDom('myname');
var valeur=form.getValues();
alert(valeur['name']);
// alert(champsNom.innerHTML);
// Send an AJAX request with form data to the URL for contact.php
Ext.Ajax.request({
url: 'contact.php',
params: {
id: 1
},
success: function(response){
var texte = response.responseText;
alert(texte);
// process server response here
}
});
// Call the success callback if we get a non-error response from the server
form.submit({
success: function() {
// Run the callback function when a user taps the OK button
Ext.Msg.alert('Thank You', 'Your message has been received', function() {
//form.reset();
});
}
});
}
}
]
}
]
}
}); |
Partager