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": 400,
12             "resizable": false,
13             "title": "Edit / Create Person",
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                                     "|xns": "Roo.form",
41                                     "xtype": "ComboBox",
42                                     "allowBlank": "false",
43                                     "editable": "false",
44                                     "emptyText": "Select Companies",
45                                     "forceSelection": true,
46                                     "listWidth": 400,
47                                     "loadingText": "Searching...",
48                                     "minChars": 2,
49                                     "pageSize": 20,
50                                     "qtip": "Select Companies",
51                                     "selectOnFocus": true,
52                                     "triggerAction": "all",
53                                     "typeAhead": true,
54                                     "width": 300,
55                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> </div>",
56                                     "queryParam": "query[code]",
57                                     "fieldLabel": "Company",
58                                     "valueField": "id",
59                                     "displayField": "code",
60                                     "hiddenName": "company_id",
61                                     "name": "company_id_code",
62                                     "items": [
63                                         {
64                                             "*prop": "store",
65                                             "xtype": "Store",
66                                             "|xns": "Roo.data",
67                                             "remoteSort": true,
68                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
69                                             "listeners": {
70                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
71                                             },
72                                             "items": [
73                                                 {
74                                                     "*prop": "proxy",
75                                                     "xtype": "HttpProxy",
76                                                     "method": "GET",
77                                                     "|xns": "Roo.data",
78                                                     "|url": "baseURL + '/Roo/Companies.php'"
79                                                 },
80                                                 {
81                                                     "*prop": "reader",
82                                                     "xtype": "JsonReader",
83                                                     "|xns": "Roo.data",
84                                                     "id": "id",
85                                                     "root": "data",
86                                                     "totalProperty": "total",
87                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"code\",\"type\":\"string\"}]"
88                                                 }
89                                             ]
90                                         }
91                                     ]
92                                 },
93                                 {
94                                     "|xns": "Roo.form",
95                                     "xtype": "ComboBox",
96                                     "allowBlank": "false",
97                                     "editable": "false",
98                                     "emptyText": "Select Office",
99                                     "forceSelection": true,
100                                     "listWidth": 400,
101                                     "loadingText": "Searching...",
102                                     "minChars": 2,
103                                     "pageSize": 20,
104                                     "qtip": "Select Office",
105                                     "selectOnFocus": true,
106                                     "triggerAction": "all",
107                                     "typeAhead": true,
108                                     "width": 300,
109                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
110                                     "queryParam": "query[name]",
111                                     "fieldLabel": "Office",
112                                     "valueField": "id",
113                                     "displayField": "name",
114                                     "hiddenName": "office_id",
115                                     "name": "office_id_name",
116                                     "items": [
117                                         {
118                                             "*prop": "store",
119                                             "xtype": "Store",
120                                             "|xns": "Roo.data",
121                                             "remoteSort": true,
122                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
123                                             "listeners": {
124                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
125                                             },
126                                             "items": [
127                                                 {
128                                                     "*prop": "proxy",
129                                                     "xtype": "HttpProxy",
130                                                     "method": "GET",
131                                                     "|xns": "Roo.data",
132                                                     "|url": "baseURL + '/Roo/Office.php'"
133                                                 },
134                                                 {
135                                                     "*prop": "reader",
136                                                     "xtype": "JsonReader",
137                                                     "|xns": "Roo.data",
138                                                     "id": "id",
139                                                     "root": "data",
140                                                     "totalProperty": "total",
141                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
142                                                 }
143                                             ]
144                                         }
145                                     ]
146                                 },
147                                 {
148                                     "fieldLabel": "Name",
149                                     "name": "name",
150                                     "width": 300,
151                                     "xtype": "TextField",
152                                     "|xns": "Roo.form"
153                                 },
154                                 {
155                                     "fieldLabel": "Role",
156                                     "name": "role",
157                                     "width": 200,
158                                     "|xns": "Roo.form",
159                                     "xtype": "TextField"
160                                 },
161                                 {
162                                     "fieldLabel": "Phone",
163                                     "name": "phone",
164                                     "width": 200,
165                                     "|xns": "Roo.form",
166                                     "xtype": "TextField"
167                                 },
168                                 {
169                                     "fieldLabel": "Fax",
170                                     "name": "fax",
171                                     "width": 200,
172                                     "|xns": "Roo.form",
173                                     "xtype": "TextField"
174                                 },
175                                 {
176                                     "fieldLabel": "Email",
177                                     "name": "email",
178                                     "width": 200,
179                                     "|xns": "Roo.form",
180                                     "xtype": "TextField"
181                                 },
182                                 {
183                                     "name": "id",
184                                     "|xns": "Roo.form",
185                                     "xtype": "Hidden"
186                                 }
187                             ]
188                         }
189                     ]
190                 },
191                 {
192                     "listeners": {
193                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
194                     },
195                     "*prop": "buttons[]",
196                     "text": "Cancel",
197                     "xtype": "Button",
198                     "|xns": "Roo"
199                 },
200                 {
201                     "listeners": {
202                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
203                     },
204                     "*prop": "buttons[]",
205                     "text": "Save",
206                     "xtype": "Button",
207                     "|xns": "Roo"
208                 }
209             ]
210         }
211     ],
212     "permname": ""
213 }