DataObjects/Core_domain.php
[Pman.Core] / Pman.Dialog.CoreImportUrl.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Dialog.CoreImportUrl = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             closable : false,
34             collapsible : false,
35             draggable : false,
36             height : 140,
37             modal : true,
38             resizable : false,
39             title : "Import URL",
40             width : 500,
41             items : [
42                 {
43                     xtype: 'ContentPanel',
44                     xns: Roo,
45                     region : 'center',
46                     items : [
47                         {
48                             xtype: 'Form',
49                             xns: Roo.form,
50                             listeners : {
51                                 actioncomplete : function (_self, action)
52                                 {
53                                      if (action.type == 'setdata') {
54                                         if(_this.data.target){
55                                             _this.form.url = baseURL + _this.data.target;
56                                         }\r
57                                        // _this.dialog.el.mask("Loading");\r
58                                        // if(_this.data.id*1 > 0)\r
59                                        //     this.load({ method: 'GET', params: { '_id' : _this.data.id }});\r
60                                        \r
61                                        return;\r
62                                     }\r
63                                     if (action.type == 'load') {\r
64                                  \r
65                                         return;\r
66                                     }\r
67                                     if (action.type =='submit') {\r
68                                     \r
69                                         //action.result.data\r
70                                         _this.dialog.hide();\r
71                                     //    Roo.log(_this.callback);\r
72                                          if (_this.callback) {\r
73                                             _this.callback.call(_this, action.result.data);\r
74                                          }\r
75                                          _this.form.reset();\r
76                                          return;\r
77                                     }
78                                 },
79                                 rendered : function (form)
80                                 {
81                                     _this.form= form;
82                                 }
83                             },
84                             method : 'POST',
85                             style : 'margin:10px;',
86                             url : baseURL,
87                             items : [
88                                 {
89                                     xtype: 'TextField',
90                                     xns: Roo.form,
91                                     fieldLabel : 'URL',
92                                     name : 'importUrl',
93                                     vtype : 'url',
94                                     width : 250
95                                 }
96                             ]
97                         }
98                     ]
99                 }
100             ],
101             center : {
102                 xtype: 'LayoutRegion',
103                 xns: Roo
104             },
105             buttons : [
106                 {
107                     xtype: 'Button',
108                     xns: Roo,
109                     listeners : {
110                         click : function (_self, e)
111                         {
112                             _this.dialog.hide();
113                         }
114                     },
115                     text : "Cancel"
116                 },
117                 {
118                     xtype: 'Button',
119                     xns: Roo,
120                     listeners : {
121                         click : function (_self, e)
122                         {
123                             _this.form.doAction("submit");
124                         }
125                     },
126                     text : "OK"
127                 }
128             ]
129         });
130     }
131 };