Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.ns('Ext.app');
  8. Ext.app.ContactForm = Ext.extend(Ext.FormPanel, {
  9. formTitle: 'Contact Information (English)',
  10. firstName: 'First Name',
  11. lastName: 'Surname',
  12. surnamePrefix: 'Surname Prefix',
  13. company: 'Company',
  14. state: 'State',
  15. stateEmptyText: 'Choose a state...',
  16. email: 'E-mail',
  17. birth: 'Date of Birth',
  18. save: 'Save',
  19. cancel: 'Cancel',
  20. initComponent : function(config) {
  21. Ext.apply(this, {
  22. labelWidth: 100, // label settings here cascade unless overridden
  23. url:'save-form.php',
  24. frame:true,
  25. title: this.formTitle,
  26. bodyStyle:'padding:5px 5px 0',
  27. width: 370,
  28. defaults: {width: 220},
  29. defaultType: 'textfield',
  30. items: [{
  31. fieldLabel: this.firstName,
  32. name: 'firstname',
  33. allowBlank:false
  34. },{
  35. fieldLabel: this.lastName,
  36. name: 'lastName'
  37. },{
  38. fieldLabel: this.surnamePrefix,
  39. width: 50,
  40. name: 'surnamePrefix'
  41. },{
  42. fieldLabel: this.company,
  43. name: 'company'
  44. }, new Ext.form.ComboBox({
  45. fieldLabel: this.province,
  46. hiddenName: 'state',
  47. store: new Ext.data.ArrayStore({
  48. fields: ['provincie'],
  49. data : Ext.exampledata.dutch_provinces // from dutch-provinces.js
  50. }),
  51. displayField: 'provincie',
  52. typeAhead: true,
  53. mode: 'local',
  54. triggerAction: 'all',
  55. emptyText: this.stateEmtyText,
  56. selectOnFocus:true,
  57. width:190
  58. }), {
  59. fieldLabel: this.email,
  60. name: 'email',
  61. vtype:'email'
  62. }, new Ext.form.DateField({
  63. fieldLabel: this.birth,
  64. name: 'birth'
  65. })
  66. ],
  67. buttons: [{
  68. text: this.save
  69. },{
  70. text: this.cancel
  71. }]
  72. });
  73. Ext.app.ContactForm.superclass.initComponent.apply(this, arguments);
  74. }
  75. });
  76. Ext.onReady(function(){
  77. Ext.QuickTips.init();
  78. // turn on validation errors beside the field globally
  79. Ext.form.Field.prototype.msgTarget = 'side';
  80. var bd = Ext.getBody();
  81. bd.createChild({tag: 'h2', html: 'Localized Contact Form'});
  82. // simple form
  83. var simple = new Ext.app.ContactForm();
  84. simple.render(document.body);
  85. });