Guest User

Untitled

a guest
Nov 19th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. this.disruptForm = new One.model.ModelFormContainer({
  2. modelInfo: {
  3. modelLevelType: 'Event'
  4. }
  5. ,createActionName: 'ONEI.CreateDisruption'
  6. ,defaultActionName: 'ONEI.CreateDisruption'
  7. ,values: {
  8. longitude: desc.center.lng
  9. ,latitude: desc.center.lat
  10. ,radius: desc.radius
  11. ,radiusUOM: desc.radiusUOM
  12. }
  13. ,listeners: {
  14. beforetransition: {
  15. scope: this
  16. ,fn: function() {
  17. this.disruptDialog.hide();
  18. this.disruptForm.getCurrentPage().resetAll();
  19. this.disruptForm.getCurrentPage().getMessagePanel().hide();
  20. delete this.disruptForm.sysId;
  21. }
  22. }
  23. }
  24. ,defaultConfig: {
  25. prepareFields: function(fields) {
  26. fields.addAll([{
  27. xtype: 'numberfield'
  28. ,name: 'longitude'
  29. ,ref: '../lonfield'
  30. ,hidden: true
  31. },{
  32. xtype: 'numberfield'
  33. ,name: 'latitude'
  34. ,ref: '../latfield'
  35. ,hidden: true
  36. },{
  37. xtype: 'numberfield'
  38. ,name: 'radius'
  39. ,ref: '../radfield'
  40. ,hidden: true
  41. },{
  42. xtype: 'textfield'
  43. ,name: 'radiusUOM'
  44. ,ref: '../radUOMfield'
  45. ,hidden: true
  46. }]);
  47. }
  48. ,listeners: {
  49. actionsuccess: {
  50. scope: this
  51. ,fn: function() {
  52. this.disruptDialog.hide();
  53. this.disruptForm.getCurrentPage().resetAll();
  54. this.disruptForm.getCurrentPage().getMessagePanel().hide();
  55. delete this.disruptForm.sysId;
  56. this.onCreateDisruption(this.currentDis);
  57. }
  58. }
  59. ,actioncancel: {
  60. scope: this
  61. ,fn: function() {
  62. this.disruptDialog.hide();
  63. this.disruptForm.getCurrentPage().resetAll();
  64. this.disruptForm.getCurrentPage().getMessagePanel().hide();
  65. delete this.disruptForm.sysId;
  66. }
  67. }
  68. ,bbarconfig: {
  69. scope: this
  70. ,fn: function(formPanel, bbarcfg) {
  71. bbarcfg.push({
  72. xtype: 'button'
  73. ,text: Labels.get('global/cancel')
  74. ,scope: formPanel
  75. ,handler: function() {
  76. this.fireEvent('actioncancel');
  77. }
  78. });
  79. }
  80. }
  81. }
  82. }
  83. });
Add Comment
Please, Sign In to add comment