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.

70 lines
1.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.QuickTips.init();
  8. Ext.onReady(function(){
  9. var fp = new Ext.FormPanel({
  10. id: 'status-form',
  11. renderTo: Ext.getBody(),
  12. labelWidth: 75,
  13. width: 350,
  14. buttonAlign: 'right',
  15. border: false,
  16. bodyStyle: 'padding:10px 10px 0;',
  17. defaults: {
  18. anchor: '95%',
  19. allowBlank: false,
  20. selectOnFocus: true,
  21. msgTarget: 'side'
  22. },
  23. items:[{
  24. xtype: 'textfield',
  25. fieldLabel: 'Name',
  26. blankText: 'Name is required'
  27. },{
  28. xtype: 'datefield',
  29. fieldLabel: 'Birthdate',
  30. blankText: 'Birthdate is required'
  31. }],
  32. buttons: [{
  33. text: 'Save',
  34. handler: function(){
  35. if(fp.getForm().isValid()){
  36. var sb = Ext.getCmp('form-statusbar');
  37. sb.showBusy('Saving form...');
  38. fp.getEl().mask();
  39. fp.getForm().submit({
  40. url: 'fake.php',
  41. success: function(){
  42. sb.setStatus({
  43. text:'Form saved!',
  44. iconCls:'',
  45. clear: true
  46. });
  47. fp.getEl().unmask();
  48. }
  49. });
  50. }
  51. }
  52. }]
  53. });
  54. new Ext.Panel({
  55. title: 'StatusBar with Integrated Form Validation',
  56. renderTo: Ext.getBody(),
  57. width: 350,
  58. autoHeight: true,
  59. layout: 'fit',
  60. items: fp,
  61. bbar: new Ext.ux.StatusBar({
  62. id: 'form-statusbar',
  63. defaultText: 'Ready',
  64. plugins: new Ext.ux.ValidationStatus({form:'status-form'})
  65. })
  66. });
  67. });