fix variables on update
[Pman.Core] / Pman.Dialog.CoreColumnConfig.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.CoreColumnConfig = {
8
9  _strings : {
10   'cfcd208495d565ef66e7dff9f98764da' :"0",
11   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
12   'c40cab5f875bb6c270d800eff77a4af0' :"Save Column Configuration",
13   'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
14   'c9cc8cce247e49bae79f15173ce97354' :"Save"
15  },
16  _named_strings : {
17   'description_fieldLabel' : 'b5a7adde1af5c87d7fd797b6245c2a39' /* Description */ ,
18   'name_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ 
19  },
20
21  dialog : false,
22  callback:  false,
23
24  show : function(data, cb)
25  {
26   if (!this.dialog) {
27    this.create();
28   }
29
30   this.callback = cb;
31   this.data = data;
32   this.dialog.show(this.data._el);
33   if (this.form) {
34    this.form.reset();
35    this.form.setValues(data);
36    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
37   }
38
39  },
40
41  create : function()
42  {
43    var _this = this;
44    this.dialog = Roo.factory({
45     xtype : 'LayoutDialog',
46     background : true,
47     closable : false,
48     collapsible : false,
49     height : 110,
50     modal : true,
51     resizable : false,
52     title : _this._strings['c40cab5f875bb6c270d800eff77a4af0'] /* Save Column Configuration */,
53     width : 400,
54     listeners : {
55      show : function (_self)
56       {
57           
58       }
59     },
60     xns : Roo,
61     '|xns' : 'Roo',
62     center : {
63      xtype : 'LayoutRegion',
64      titlebar : false,
65      xns : Roo,
66      '|xns' : 'Roo'
67     },
68     buttons : [
69      {
70       xtype : 'Button',
71       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
72       listeners : {
73        click : function() {
74             _this.form.reset();
75             _this.dialog.hide();
76         }
77       },
78       xns : Roo,
79       '|xns' : 'Roo'
80      },
81      {
82       xtype : 'Button',
83       text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
84       listeners : {
85        click : function() {
86         
87              
88             _this.form.doAction('submit');
89             
90         }
91       },
92       xns : Roo,
93       '|xns' : 'Roo'
94      }
95     ],
96     items  : [
97      {
98       xtype : 'ContentPanel',
99       background : true,
100       fitToFrame : true,
101       region : 'center',
102       xns : Roo,
103       '|xns' : 'Roo',
104       items  : [
105        {
106         xtype : 'Form',
107         method : 'POST',
108         style : 'padding:5px',
109         url : baseURL + '/Roo/core_setting',
110         listeners : {
111          actioncomplete : function (_self, action)
112           {
113             if (action.type == 'setdata') {
114           
115                   
116                   
117                   if(typeof(_this.data.title) != 'undefined' && _this.data.title.length){
118                       _this.dialog.setTitle(_this.data.title);
119                   }
120             
121                   if(_this.data.id){
122                       _this.dialog.el.mask("Loading");
123                       this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
124                   }
125                  
126                  return;
127               }
128               if (action.type == 'load') {
129                   _this.dialog.el.unmask();
130                   return;
131               }
132               if (action.type == 'submit' ) {
133                   _this.dialog.el.unmask();
134                   _this.dialog.hide();
135           
136                   if (_this.callback) {
137                      _this.callback.call(_this, action.result.data);
138                   }
139                   _this.form.reset();
140               }
141           },
142          rendered : function (form)
143           {
144              _this.form = form;
145           }
146         },
147         xns : Roo.form,
148         '|xns' : 'Roo.form',
149         items  : [
150          {
151           xtype : 'TextField',
152           allowBlank : false,
153           fieldLabel : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
154           name : 'description',
155           width : 250,
156           xns : Roo.form,
157           '|xns' : 'Roo.form'
158          },
159          {
160           xtype : 'Hidden',
161           name : 'module',
162           xns : Roo.form,
163           '|xns' : 'Roo.form'
164          },
165          {
166           xtype : 'Hidden',
167           name : 'val',
168           xns : Roo.form,
169           '|xns' : 'Roo.form'
170          },
171          {
172           xtype : 'Hidden',
173           name : 'name',
174           value : 0,
175           xns : Roo.form,
176           '|xns' : 'Roo.form'
177          },
178          {
179           xtype : 'Hidden',
180           name : 'id',
181           xns : Roo.form,
182           '|xns' : 'Roo.form'
183          }
184         ]
185        }
186       ]
187      }
188     ]
189    });
190  }
191 };