named-arguments.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Ext.require([
  2. 'Ext.direct.*',
  3. 'Ext.form.Panel',
  4. 'Ext.form.field.Text',
  5. 'Ext.form.field.Number'
  6. ]);
  7. Ext.onReady(function(){
  8. Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
  9. var form = Ext.create('Ext.form.Panel', {
  10. width: 300,
  11. height: 130,
  12. renderTo: document.body,
  13. bodyPadding: 5,
  14. items: [{
  15. xtype: 'textfield',
  16. fieldLabel: 'First Name',
  17. name: 'firstName',
  18. value: 'Evan',
  19. allowBlank: false
  20. }, {
  21. xtype: 'textfield',
  22. fieldLabel: 'Last Name',
  23. name: 'lastName',
  24. value: 'Trimboli',
  25. allowBlank: false
  26. }, {
  27. xtype: 'numberfield',
  28. fieldLabel: 'Age',
  29. name: 'age',
  30. value: 25,
  31. allowBlank: false
  32. }],
  33. dockedItems: [{
  34. dock: 'bottom',
  35. ui: 'footer',
  36. xtype: 'toolbar',
  37. items: ['->', {
  38. formBind: true,
  39. text: 'Send',
  40. handler: function(){
  41. var values = form.getForm().getValues();
  42. TestAction.showDetails(values, function(value){
  43. Ext.example.msg('Server Response', value);
  44. });
  45. }
  46. }]
  47. }]
  48. });
  49. });