absform.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Ext.require([
  2. 'Ext.form.*',
  3. 'Ext.layout.container.Absolute',
  4. 'Ext.window.Window'
  5. ]);
  6. Ext.onReady(function() {
  7. var form = Ext.create('Ext.form.Panel', {
  8. layout: 'absolute',
  9. url: 'save-form.php',
  10. defaultType: 'textfield',
  11. border: false,
  12. items: [{
  13. fieldLabel: 'Send To',
  14. fieldWidth: 60,
  15. msgTarget: 'side',
  16. allowBlank: false,
  17. x: 5,
  18. y: 5,
  19. name: 'to',
  20. anchor: '-5' // anchor width by percentage
  21. }, {
  22. fieldLabel: 'Subject',
  23. fieldWidth: 60,
  24. x: 5,
  25. y: 35,
  26. name: 'subject',
  27. anchor: '-5' // anchor width by percentage
  28. }, {
  29. x:5,
  30. y: 65,
  31. xtype: 'textarea',
  32. style: 'margin:0',
  33. hideLabel: true,
  34. name: 'msg',
  35. anchor: '-5 -5' // anchor width and height
  36. }]
  37. });
  38. var win = Ext.create('Ext.window.Window', {
  39. title: 'Resize Me',
  40. width: 500,
  41. height: 300,
  42. minWidth: 300,
  43. minHeight: 200,
  44. layout: 'fit',
  45. plain:true,
  46. items: form,
  47. buttons: [{
  48. text: 'Send'
  49. },{
  50. text: 'Cancel'
  51. }]
  52. });
  53. win.show();
  54. });