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