Pman.Dialog.CorePersonContact.bjs
[Pman.Core] / Pman.Dialog.CorePersonContact.bjs
1 {
2     "id": "roo-file-129",
3     "name": "Pman.Dialog.CorePersonContact",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.Core/Pman.Dialog.CorePersonContact.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 350,
12             "resizable": false,
13             "title": "Edit / Create Contact Details",
14             "width": 500,
15             "xtype": "LayoutDialog",
16             "|xns": "Roo",
17             "items": [
18                 {
19                     "|xns": "Roo",
20                     "xtype": "LayoutRegion",
21                     "*prop": "center"
22                 },
23                 {
24                     "region": "center",
25                     "xtype": "ContentPanel",
26                     "|xns": "Roo",
27                     "items": [
28                         {
29                             "|xns": "Roo.form",
30                             "xtype": "Form",
31                             "listeners": {
32                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
33                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
34                             },
35                             "method": "POST",
36                             "style": "margin:10px;",
37                             "|url": "baseURL + '/Roo/Person.php'",
38                             "items": [
39                                 {
40                                     "listeners": {
41                                         "add": "function (combo)\n{\n\n    Pman.Dialog.Companies.show( {  id: 0 },  function(data) {\n            _this.form.setValues({\n                    company_id_name : data.name,\n                    company_id : data.id\n            });\n    }); \n}"
42                                     },
43                                     "allowBlank": "false",
44                                     "displayField": "code",
45                                     "editable": "false",
46                                     "emptyText": "Select Companies",
47                                     "fieldLabel": "Company",
48                                     "forceSelection": true,
49                                     "hiddenName": "company_id",
50                                     "listWidth": 400,
51                                     "loadingText": "Searching...",
52                                     "minChars": 2,
53                                     "name": "company_id_code",
54                                     "pageSize": 20,
55                                     "qtip": "Select Companies",
56                                     "queryParam": "query[code]",
57                                     "selectOnFocus": true,
58                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> </div>",
59                                     "triggerAction": "all",
60                                     "typeAhead": true,
61                                     "valueField": "id",
62                                     "width": 300,
63                                     "xtype": "ComboBox",
64                                     "|xns": "Roo.form",
65                                     "items": [
66                                         {
67                                             "*prop": "store",
68                                             "xtype": "Store",
69                                             "|xns": "Roo.data",
70                                             "remoteSort": true,
71                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
72                                             "listeners": {
73                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
74                                             },
75                                             "items": [
76                                                 {
77                                                     "*prop": "proxy",
78                                                     "xtype": "HttpProxy",
79                                                     "method": "GET",
80                                                     "|xns": "Roo.data",
81                                                     "|url": "baseURL + '/Roo/Companies.php'"
82                                                 },
83                                                 {
84                                                     "*prop": "reader",
85                                                     "xtype": "JsonReader",
86                                                     "|xns": "Roo.data",
87                                                     "id": "id",
88                                                     "root": "data",
89                                                     "totalProperty": "total",
90                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"code\",\"type\":\"string\"}]"
91                                                 }
92                                             ]
93                                         }
94                                     ]
95                                 },
96                                 {
97                                     "|xns": "Roo.form",
98                                     "xtype": "ComboBox",
99                                     "allowBlank": "false",
100                                     "editable": "false",
101                                     "emptyText": "Select Office",
102                                     "forceSelection": true,
103                                     "listWidth": 400,
104                                     "loadingText": "Searching...",
105                                     "minChars": 2,
106                                     "pageSize": 20,
107                                     "qtip": "Select Office",
108                                     "selectOnFocus": true,
109                                     "triggerAction": "all",
110                                     "typeAhead": true,
111                                     "width": 300,
112                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
113                                     "queryParam": "query[name]",
114                                     "fieldLabel": "Office",
115                                     "valueField": "id",
116                                     "displayField": "name",
117                                     "hiddenName": "office_id",
118                                     "name": "office_id_name",
119                                     "items": [
120                                         {
121                                             "listeners": {
122                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    var coid = _this.form.findField('company_id').getValue();\n    o.params.company_id = coid;\n}\n"
123                                             },
124                                             "*prop": "store",
125                                             "remoteSort": true,
126                                             "xtype": "Store",
127                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
128                                             "|xns": "Roo.data",
129                                             "items": [
130                                                 {
131                                                     "*prop": "proxy",
132                                                     "xtype": "HttpProxy",
133                                                     "method": "GET",
134                                                     "|xns": "Roo.data",
135                                                     "|url": "baseURL + '/Roo/Office.php'"
136                                                 },
137                                                 {
138                                                     "*prop": "reader",
139                                                     "xtype": "JsonReader",
140                                                     "|xns": "Roo.data",
141                                                     "id": "id",
142                                                     "root": "data",
143                                                     "totalProperty": "total",
144                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
145                                                 }
146                                             ]
147                                         }
148                                     ]
149                                 },
150                                 {
151                                     "fieldLabel": "Name",
152                                     "name": "name",
153                                     "width": 300,
154                                     "xtype": "TextField",
155                                     "|xns": "Roo.form"
156                                 },
157                                 {
158                                     "fieldLabel": "Role",
159                                     "name": "role",
160                                     "width": 200,
161                                     "|xns": "Roo.form",
162                                     "xtype": "TextField"
163                                 },
164                                 {
165                                     "fieldLabel": "Phone",
166                                     "name": "phone",
167                                     "width": 200,
168                                     "|xns": "Roo.form",
169                                     "xtype": "TextField"
170                                 },
171                                 {
172                                     "fieldLabel": "Fax",
173                                     "name": "fax",
174                                     "width": 200,
175                                     "|xns": "Roo.form",
176                                     "xtype": "TextField"
177                                 },
178                                 {
179                                     "fieldLabel": "Email",
180                                     "name": "email",
181                                     "width": 200,
182                                     "|xns": "Roo.form",
183                                     "xtype": "TextField"
184                                 },
185                                 {
186                                     "name": "id",
187                                     "|xns": "Roo.form",
188                                     "xtype": "Hidden"
189                                 }
190                             ]
191                         }
192                     ]
193                 },
194                 {
195                     "listeners": {
196                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
197                     },
198                     "*prop": "buttons[]",
199                     "text": "Cancel",
200                     "xtype": "Button",
201                     "|xns": "Roo"
202                 },
203                 {
204                     "listeners": {
205                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
206                     },
207                     "*prop": "buttons[]",
208                     "text": "Save",
209                     "xtype": "Button",
210                     "|xns": "Roo"
211                 }
212             ]
213         }
214     ],
215     "permname": ""
216 }