Pman.Dialog.BAdminImportUrl.bjs
[Pman.BAdmin] / Pman.Dialog.BAdminImportUrl.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.BAdminImportUrl= function() {}
8 Roo.apply(Pman.Dialog.BAdminImportUrl.prototype, {
9
10  _strings : {
11   'c8c55f55be8cbe3141db7e26ab0a8b4e' :"Import URL",
12   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
13   'e0aa021e21dddbd6d8cecec71e9cf564' :"OK",
14   'e6b391a8d2c4d45902a23a8b6585703d' :"URL"
15  },
16
17  dialog : false,
18  callback:  false,
19
20  show : function(data, cb)
21  {
22   if (!this.dialog) {
23    this.create();
24   }
25
26   this.callback = cb;
27   this.data = data;
28   this.dialog.show(this.data._el);
29   if (this.form) {
30    this.form.reset();
31    this.form.setValues(data);
32    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
33   }
34
35  },
36
37  create : function()
38  {
39   var _this = this;
40   this.dialog = Roo.factory({
41     xtype : 'Modal',
42     title : _this._strings['c8c55f55be8cbe3141db7e26ab0a8b4e'] /* Import URL */,
43     xns : Roo.bootstrap,
44     '|xns' : 'Roo.bootstrap',
45     buttons : [
46      {
47       xtype : 'Button',
48       html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
49       weight : 'default',
50       listeners : {
51        click : function (_self, e)
52         {
53             _this.dialog.hide();
54         }
55       },
56       xns : Roo.bootstrap,
57       '|xns' : 'Roo.bootstrap'
58      },
59      {
60       xtype : 'Button',
61       html : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
62       weight : 'primary',
63       listeners : {
64        click : function (_self, e)
65         {
66             _this.form.doAction("submit");
67         }
68       },
69       xns : Roo.bootstrap,
70       '|xns' : 'Roo.bootstrap'
71      }
72     ],
73     items  : [
74      {
75       xtype : 'Form',
76       method : 'POST',
77       url : baseURL,
78       listeners : {
79        actioncomplete : function (_self, action)
80         {
81              if (action.type == 'setdata') {
82                 if(_this.data.target){
83                     _this.form.url = baseURL + _this.data.target;
84                 }
85                
86                
87                /*\r
88                if(_this.data.id*1 > 0) {\r
89                    this.load({ method: 'GET', params: { '_id' : _this.data.id }});
90                }\r
91                */\r
92             }
93             \r
94             if (action.type == 'load') {\r
95                 return;\r
96             }
97             \r
98             if (action.type =='submit') {\r
99                 //action.result.data\r
100                 _this.dialog.hide();\r
101                 //Roo.log(_this.callback);\r
102                  if (_this.callback) {\r
103                     _this.callback.call(_this, action.result.data);\r
104                  }\r
105                  _this.form.reset();\r
106                  return;\r
107             }
108         },
109        actionfailed : function (_self, action)
110         {
111             if (action.type == 'submit') {
112             
113                 Roo.log('failing');
114                 Roo.log(action.result.data);
115             }
116         },
117        render : function (_self)
118         {
119             _this.form = this;
120         }
121       },
122       xns : Roo.bootstrap,
123       '|xns' : 'Roo.bootstrap',
124       items  : [
125        {
126         xtype : 'Input',
127         fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
128         labelAlign : 'left',
129         labelWidth : 1,
130         name : 'importUrl',
131         xns : Roo.bootstrap,
132         '|xns' : 'Roo.bootstrap'
133        }
134       ]
135      }
136     ]
137    }  );
138  }
139 });
140 Roo.apply(Pman.Dialog.BAdminImportUrl, Pman.Dialog.BAdminImportUrl.prototype);