]>
git.proxmox.com Git - extjs.git/blob - extjs/examples/kitchensink/classic/samples/view/form/ContactFormController.js
1 Ext
.define('KitchenSink.view.form.ContactFormController', {
2 extend
: 'Ext.app.ViewController',
3 alias
: 'controller.form-contact',
5 showWindow: function() {
6 var win
= this.lookupReference('popupWindow');
9 win
= new KitchenSink
.view
.form
.ContactFormWindow();
11 // A Window is a floating component, so by default it is not connected
12 // to our main View in any way. By adding it, we are creating this link
13 // and allow the window to be controlled by the main ViewController,
14 // as well as be destroyed automatically along with the main View.
15 this.getView().add(win
);
21 onFormCancel: function() {
22 this.lookupReference('windowForm').getForm().reset();
23 this.lookupReference('popupWindow').hide();
26 onFormSubmit: function() {
27 var formPanel
= this.lookupReference('windowForm'),
28 form
= formPanel
.getForm();
31 // In a real application, this would submit the form to the configured url
34 this.lookupReference('popupWindow').hide();
37 'Your inquiry has been sent. We will respond as soon as possible.'