Pman.Dialog.BAdminCoreEnum.bjs
[Pman.BAdmin] / Pman.Dialog.BAdminCoreEnum.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.BAdminCoreEnum= function() {}
8 Roo.apply(Pman.Dialog.BAdminCoreEnum.prototype, {
9
10  _strings : {
11   'd5cf6a6c4887716d7a14a84d9ba81b02' :"Add / Edit Pulldown Option",
12   'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
13   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
14   '49ee3087348e8d44e1feda1917443987' :"Name",
15   'c9cc8cce247e49bae79f15173ce97354' :"Save"
16  },
17
18  dialog : false,
19  callback:  false,
20
21  show : function(data, cb)
22  {
23   if (!this.dialog) {
24    this.create();
25   }
26
27   this.callback = cb;
28   this.data = data;
29   this.dialog.show(this.data._el);
30   if (this.form) {
31    this.form.reset();
32    this.form.setValues(data);
33    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
34   }
35
36  },
37
38  create : function()
39  {
40   var _this = this;
41   this.dialog = Roo.factory({
42     xtype : 'Modal',
43     cls : 'enable-overflow',
44     title : _this._strings['d5cf6a6c4887716d7a14a84d9ba81b02'] /* Add / Edit Pulldown Option */,
45     xns : Roo.bootstrap,
46     '|xns' : 'Roo.bootstrap',
47     buttons : [
48      {
49       xtype : 'Button',
50       html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
51       listeners : {
52        click : function (_self, e)
53         {
54             _this.dialog.hide(); 
55         }
56       },
57       xns : Roo.bootstrap,
58       '|xns' : 'Roo.bootstrap'
59      },
60      {
61       xtype : 'Button',
62       html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
63       weight : 'primary',
64       listeners : {
65        click : function (_self, e)
66         {
67             _this.form.doAction("submit");
68             
69             return;
70         }
71       },
72       xns : Roo.bootstrap,
73       '|xns' : 'Roo.bootstrap'
74      }
75     ],
76     items  : [
77      {
78       xtype : 'Form',
79       labelAlign : 'top',
80       loadMask : true,
81       url : baseURL + '/Roo/Core_enum',
82       listeners : {
83        actioncomplete : function (_self, action)
84         {
85             if(action.type == 'setdata') {
86             
87                if(_this.data.id * 1 > 0) {
88                     
89                     this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
90                 } 
91                 
92                 return;
93             }
94            
95             if (action.type == 'load') {
96             
97                 _this.data = action.result.data;
98                 
99                 return;
100             }
101             
102             
103             if (action.type == 'submit') {
104             
105                 _this.dialog.hide();
106                
107                 if (_this.callback) {
108                     _this.callback.call(this, action.result.data);
109                 }
110                 
111                 return; 
112             }
113         },
114        actionfailed : function (_self, action)
115         {
116             Roo.bootstrap.MessageBox.alert('Error', action.result.errorMsg);
117         },
118        render : function (_self)
119         {
120             _this.form = _self;
121         }
122       },
123       xns : Roo.bootstrap,
124       '|xns' : 'Roo.bootstrap',
125       items  : [
126        {
127         xtype : 'Input',
128         fieldLabel : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
129         name : 'name',
130         xns : Roo.bootstrap,
131         '|xns' : 'Roo.bootstrap'
132        },
133        {
134         xtype : 'Input',
135         fieldLabel : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
136         name : 'display_name',
137         xns : Roo.bootstrap,
138         '|xns' : 'Roo.bootstrap'
139        },
140        {
141         xtype : 'Input',
142         xns : Roo.bootstrap,
143         '|xns' : 'Roo.bootstrap'
144        },
145        {
146         xtype : 'CheckBox',
147         boxLabel : 'Active',
148         checked : true,
149         inputValue : 1,
150         valueOff : 0,
151         xns : Roo.bootstrap,
152         '|xns' : 'Roo.bootstrap'
153        },
154        {
155         xtype : 'Input',
156         inputType : 'hidden',
157         name : 'id',
158         xns : Roo.bootstrap,
159         '|xns' : 'Roo.bootstrap'
160        },
161        {
162         xtype : 'Input',
163         inputType : 'hidden',
164         name : 'etype',
165         xns : Roo.bootstrap,
166         '|xns' : 'Roo.bootstrap'
167        }
168       ]
169      }
170     ]
171    }  );
172  }
173 });
174 Roo.apply(Pman.Dialog.BAdminCoreEnum, Pman.Dialog.BAdminCoreEnum.prototype);