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
|
Ext.ns('ObsIUEM');
ObsIUEM.wContact = Ext.extend(Ext.Window, {
initComponent : function() {
var contact = new Ext.form.FormPanel({
xtype:'form'
,id: 'mail-form'
,frame:true
,monitorValid:true
,defaults:{anchor:'95%'}
,items:[{
xtype: 'textfield'
,id: 'contactEmail'
,vtype: 'email'
,fieldLabel: 'Votre e-mail'
,allowBlank: false
,msgTarget: 'side'
,blankText: 'e-mail non valide'
},
{
xtype: 'textfield'
,id: 'contactObjet'
,fieldLabel: 'Objet'
,allowBlank: false
,msgTarget: 'side'
},
{
xtype: 'textarea'
//xtype: 'htmleditor'
,id: 'contactMsg'
,height: 350
,hideLabel: true
,allowBlank: false
,msgTarget: 'side'
}
]
,buttonAlign: 'center'
,buttons: [
{
xtype: 'button'
,text: 'Envoyer'
,icon: 'img/email_go.png'
,formBind:true
,bubbleEvents: ['envoyer']
,handler: function(){this.fireEvent('envoyer');}
},{
xtype: 'button'
,text: 'Annuler'
,icon: 'img/cross.png'
,bubbleEvents: ['annuler']
,handler: function(){this.fireEvent('annuler');}
}
]
});
var config = {
id: 'wContact'
,itemId: 'wContact'
,width: 750
,height: 500
,minWidth: 300
,minHeight: 200
,layout: 'fit'
,border: false
,frame: true
,title: 'Contact'
,items: [contact]
} // fin config
// apply config
Ext.apply(this, Ext.apply(this.initialConfig, config));
// call parent
ObsIUEM.wContact.superclass.initComponent.apply(this, arguments);
this.show();
} // fin function initComponent
,listeners: {
envoyer : function() {
Ext.getCmp('mail-form').getForm().submit({
url: 'scripts/sendMail.php?from='+Ext.getCmp('contactEmail').getValue()+
'&subject='+Ext.getCmp('contactObjet').getValue()+
'&msg='+Ext.getCmp('contactMsg').getValue(),
method: 'POST',
self: self,
scope: this});
this.close();
}
,annuler : function() {this.close();}
}
}); // fin ObsIUEM.wContact
Ext.reg('wContact', ObsIUEM.wContact); |
Partager