Pman.Dialog.CoreNotifyRecurKeywords.bjs
[Pman.Core] / Pman.Dialog.CoreNotifyRecurKeywords.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.CoreNotifyRecurKeywords = {
8
9  _strings : {
10   'cfcd208495d565ef66e7dff9f98764da' :"0",
11   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
12   'e0aa021e21dddbd6d8cecec71e9cf564' :"OK",
13   '790f855c2139f2faecb810519e90b833' :"Add Notification Keywords"
14  },
15
16  dialog : false,
17  callback:  false,
18
19  show : function(data, cb)
20  {
21   if (!this.dialog) {
22    this.create();
23   }
24
25   this.callback = cb;
26   this.data = data;
27   this.dialog.show(this.data._el);
28   if (this.form) {
29    this.form.reset();
30    this.form.setValues(data);
31    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
32   }
33
34  },
35
36  create : function()
37  {
38    var _this = this;
39    this.dialog = Roo.factory({
40     center : {
41      '|xns' : 'Roo',
42      titlebar : false,
43      xns : Roo,
44      xtype : 'LayoutRegion'
45     },
46     '|xns' : 'Roo',
47     background : true,
48     closable : false,
49     collapsible : false,
50     height : 150,
51     modal : true,
52     resizable : false,
53     title : _this._strings['790f855c2139f2faecb810519e90b833'],
54     width : 400,
55     xns : Roo,
56     xtype : 'LayoutDialog',
57     buttons : [
58       {
59        '|xns' : 'Roo',
60        text : _this._strings['ea4788705e6873b424c65e91c2846b19'],
61        xns : Roo,
62        xtype : 'Button',
63        listeners : {
64         click : function() {
65              _this.form.reset();
66              _this.dialog.hide();
67          }
68        }
69       },
70 {
71        '|xns' : 'Roo',
72        text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'],
73        xns : Roo,
74        xtype : 'Button',
75        listeners : {
76         click : function() {
77          
78              var name =     _this.form.findField('name').getValue();
79              name = name.toUpperCase().replace(/[^A-Z]+/g, '');
80              if (!name.length) {
81                  Roo.MessageBox.alert("Error","Please fill in a valid name");
82                  return;
83              }
84              _this.form.findField('name').setValue(name);
85           
86              _this.form.doAction('submit');
87              
88          }
89        }
90       }
91     ],
92     listeners : {
93      show : function (_self)
94       {
95           
96       }
97     },
98     items : [
99      {
100       '|xns' : 'Roo',
101       background : true,
102       fitToFrame : true,
103       region : 'center',
104       xns : Roo,
105       xtype : 'ContentPanel',
106       items : [
107        {
108         '|xns' : 'Roo.form',
109         method : 'POST',
110         style : 'margin: 5px',
111         url : baseURL + '/Roo/Core_notify_recur.php',
112         xns : Roo.form,
113         xtype : 'Form',
114         listeners : {
115          actioncomplete : function (_self, action)
116           {
117             if (action.type == 'setdata') {
118           
119                  return;
120               }
121               if (action.type == 'load') {
122                   _this.dialog.el.unmask();
123                   return;
124               }
125               if (action.type == 'submit' ) {
126                   _this.dialog.el.unmask();
127                   _this.dialog.hide();
128           
129                   if (_this.callback) {
130                      _this.callback.call(_this, action.result.data);
131                   }
132                   _this.form.reset();
133               }
134           },
135          rendered : function (form)
136           {
137              _this.form = form;
138           }
139         },
140         items : [
141          {
142           '|xns' : 'Roo.form',
143           name : 'etype',
144           xns : Roo.form,
145           xtype : 'Hidden'
146          },
147          {
148           '|xns' : 'Roo.form',
149           name : 'seqid',
150           value : 0,
151           xns : Roo.form,
152           xtype : 'Hidden'
153          },
154          {
155           '|xns' : 'Roo.form',
156           name : 'id',
157           xns : Roo.form,
158           xtype : 'Hidden'
159          }
160         ]
161
162        }
163       ]
164
165      }
166     ]
167
168    });
169  }
170 };