Guest User

Untitled

a guest
Jan 4th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Test</title>
  6.  
  7. <!-- Sencha Touch CSS -->
  8. <link rel="stylesheet" href="lib/touch/resources/css/sencha-touch.css" type="text/css">
  9.  
  10. <!-- Custom CSS -->
  11. <link rel="stylesheet" href="css/guide.css" type="text/css">
  12.  
  13. <!-- Sencha Touch JS -->
  14. <script type="text/javascript" src="lib/touch/sencha-touch-debug.js"></script>
  15.  
  16.  
  17. </head>
  18.  
  19. <body>
  20. <script>
  21. var MyForm;
  22. var MyWindow;
  23. var Txt_Name;
  24. var Txt_BirthDate;
  25.  
  26. Ext.onReady(function(){
  27.  
  28. Txt_Name = new Ext.form.TextField({
  29. id: 'Name',
  30. fieldLabel: 'Name',
  31. minLength : 1,
  32. maxLength: 20,
  33. selectOnFocus: true,
  34. allowBlank: false,
  35. anchor : '80%',
  36. maskRe: /([0-9]+)$/
  37. });
  38.  
  39. Txt_BirthDate = new Ext.form.DatePicker({
  40. id: 'BirthDate',
  41. fieldLabel: 'Birth date',
  42. vtype: 'daterange',
  43. format: 'd/m/Y',
  44. allowBlank: false,
  45. anchor : '32%'
  46. });
  47.  
  48.  
  49. MyForm = new Ext.form.FormPanel({
  50. labelAlign: 'top',
  51. frame:true,
  52. bodyStyle:'padding:5px 5px 0',
  53. width: 390,
  54. buttonAlign:'right',
  55. items: [Txt_Name, Txt_BirthDate],
  56. buttons: [{
  57. text: 'Save'
  58. },{
  59. text: 'Cancel',
  60. handler: function(){
  61. MyWindow.hide();
  62. }
  63. }]
  64. });
  65.  
  66. MyWindow = new Ext.Window({
  67. id: 'MyWindow',
  68. title: 'New Friend',
  69. closable:true,
  70. width: 350,
  71. height: 240,
  72. plain:true,
  73. layout: 'fit',
  74. items: MyForm,
  75. form: MyForm.getForm(),
  76. listeners: {
  77. "show" : function() {
  78. var firstElem = MyForm.getForm().findField(0);
  79. firstElem.focus.defer(150, firstElem);
  80. }
  81. }
  82. });
  83. MyWindow.show();
  84.  
  85. });
  86.  
  87.  
  88. </script>
  89. </body>
  90.  
  91. </html>
Add Comment
Please, Sign In to add comment