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.

86 lines
2.9 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.onReady(function(){
  8. var ct = new Ext.form.FormPanel({
  9. renderTo: 'container',
  10. width: 700,
  11. height: 400,
  12. title: 'User Details',
  13. defaultType: 'textfield',
  14. padding: 10,
  15. labelWidth: 90,
  16. items: [{
  17. fieldLabel: 'First Name'
  18. }, {
  19. fieldLabel: 'Middle Name'
  20. }, {
  21. fieldLabel: 'Last Name'
  22. }, {
  23. xtype: 'datefield',
  24. fieldLabel: 'D.O.B'
  25. }],
  26. listeners: {
  27. afterrender: function(form){
  28. var cfg = {
  29. shadow: false,
  30. completeOnEnter: true,
  31. cancelOnEsc: true,
  32. updateEl: true,
  33. ignoreNoChange: true
  34. };
  35. var labelEditor = new Ext.Editor(Ext.apply({
  36. alignment: 'l-l',
  37. listeners: {
  38. beforecomplete: function(ed, value){
  39. if(value.charAt(value.length - 1) != ':'){
  40. ed.setValue(ed.getValue() + ':');
  41. }
  42. return true;
  43. },
  44. complete: function(ed, value, oldValue){
  45. Ext.example.msg('Label Changed', '"{0}" changed to "{1}"', oldValue, value);
  46. }
  47. },
  48. field: {
  49. allowBlank: false,
  50. xtype: 'textfield',
  51. width: 90,
  52. selectOnFocus: true
  53. }
  54. }, cfg));
  55. form.body.on('dblclick', function(e, t){
  56. labelEditor.startEdit(t);
  57. }, null, {
  58. delegate: 'label.x-form-item-label'
  59. });
  60. var titleEditor = new Ext.Editor(Ext.apply({
  61. cls: 'x-small-editor',
  62. alignment: 'bl-bl?',
  63. offsets: [0, 3],
  64. listeners: {
  65. complete: function(ed, value, oldValue){
  66. Ext.example.msg('Title Changed', '"{0}" changed to "{1}"', oldValue, value);
  67. }
  68. },
  69. field: {
  70. width: 110,
  71. triggerAction: 'all',
  72. xtype: 'combo',
  73. editable: false,
  74. forceSelection: true,
  75. store: ['User Details', 'Developer Details', 'Manager Details']
  76. }
  77. }, cfg));
  78. form.header.child('.x-panel-header-text').on('dblclick', function(e, t){
  79. titleEditor.startEdit(t);
  80. });
  81. }
  82. }
  83. });
  84. });