Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleProdcat.bjs
1 {
2     "id": "roo-file-18",
3     "name": "Pman.Dialog.XtupleProdcat",
4     "parent": "",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleProdcat.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 400,
12             "modal": true,
13             "resizable": false,
14             "title": "Edit / Create Product Category",
15             "width": 450,
16             "xtype": "LayoutDialog",
17             "|xns": "Roo",
18             "items": [
19                 {
20                     "|xns": "Roo",
21                     "xtype": "LayoutRegion",
22                     "*prop": "center"
23                 },
24                 {
25                     "region": "center",
26                     "xtype": "ContentPanel",
27                     "|xns": "Roo",
28                     "items": [
29                         {
30                             "listeners": {
31                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n        if(_this.data.prodcat_id){\n            _this.dialog.el.mask(\"Loading\");\n            this.load({ method: 'GET', params: { '_id' : _this.data.prodcat_id, '_with_salesaccnt' : 1 }}); \n        }\n       \n       _this.form.findField('salesaccnt_sales_accnt_id_descrip').setValue('');\n       _this.form.findField('salesaccnt_credit_accnt_id_descrip').setValue('');\n       _this.form.findField('salesaccnt_cos_accnt_id_descrip').setValue('');\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",
32                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
33                             },
34                             "labelWidth": 150,
35                             "method": "POST",
36                             "style": "margin:10px;",
37                             "xtype": "Form",
38                             "|url": "baseURL + '/Roo/Prodcat.php'",
39                             "|xns": "Roo.form",
40                             "items": [
41                                 {
42                                     "legend": "Product Category Detail",
43                                     "style": "width:380px",
44                                     "xtype": "FieldSet",
45                                     "|xns": "Roo.form",
46                                     "items": [
47                                         {
48                                             "allowBlank": false,
49                                             "fieldLabel": "Category Code",
50                                             "name": "prodcat_code",
51                                             "width": 200,
52                                             "xtype": "TextField",
53                                             "|xns": "Roo.form"
54                                         },
55                                         {
56                                             "allowBlank": false,
57                                             "fieldLabel": "Category Description",
58                                             "name": "prodcat_descrip",
59                                             "width": 200,
60                                             "xtype": "TextField",
61                                             "|xns": "Roo.form"
62                                         }
63                                     ]
64                                 },
65                                 {
66                                     "legend": "Account Setting",
67                                     "style": "width:380px",
68                                     "xtype": "FieldSet",
69                                     "|xns": "Roo.form",
70                                     "items": [
71                                         {
72                                             "labelWidth": 150,
73                                             "xtype": "Row",
74                                             "|xns": "Roo.form",
75                                             "items": [
76                                                 {
77                                                     "listeners": {
78                                                         "beforeselect": "function (combo, record, index)\n{\n    _this.form.findField('salesaccnt_sales_accnt_id_descrip').setValue(record.data.accnt_descrip);\n}"
79                                                     },
80                                                     "allowBlank": false,
81                                                     "displayField": "accnt_name",
82                                                     "editable": true,
83                                                     "emptyText": "Select Account",
84                                                     "fieldLabel": "Inventory Sales Account",
85                                                     "forceSelection": true,
86                                                     "hiddenName": "salesaccnt_sales_accnt_id",
87                                                     "listWidth": 400,
88                                                     "loadingText": "Searching...",
89                                                     "minChars": 2,
90                                                     "name": "salesaccnt_sales_accnt_id_name",
91                                                     "pageSize": 20,
92                                                     "qtip": "Select Account",
93                                                     "queryParam": "search[name]",
94                                                     "selectOnFocus": true,
95                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{accnt_name} ( {accnt_descrip} )</b> </div>",
96                                                     "triggerAction": "all",
97                                                     "typeAhead": true,
98                                                     "valueField": "accnt_id",
99                                                     "width": 200,
100                                                     "xtype": "ComboBox",
101                                                     "|xns": "Roo.form",
102                                                     "items": [
103                                                         {
104                                                             "listeners": {
105                                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.accnt_active = 1;\n    o.params.accnt_type = 'R';\n}\n"
106                                                             },
107                                                             "*prop": "store",
108                                                             "remoteSort": true,
109                                                             "xtype": "Store",
110                                                             "|sortInfo": "{ direction : 'ASC', field: 'accnt_id' }",
111                                                             "|xns": "Roo.data",
112                                                             "items": [
113                                                                 {
114                                                                     "*prop": "proxy",
115                                                                     "method": "GET",
116                                                                     "xtype": "HttpProxy",
117                                                                     "|url": "baseURL + '/Roo/accnt.php'",
118                                                                     "|xns": "Roo.data"
119                                                                 },
120                                                                 {
121                                                                     "*prop": "reader",
122                                                                     "id": "accnt_id",
123                                                                     "root": "data",
124                                                                     "totalProperty": "total",
125                                                                     "xtype": "JsonReader",
126                                                                     "|fields": "[{\"name\":\"accnt_id\",\"type\":\"int\"},{\"name\":\"accnt_descrip\",\"type\":\"string\"}]",
127                                                                     "|xns": "Roo.data"
128                                                                 }
129                                                             ]
130                                                         }
131                                                     ]
132                                                 }
133                                             ]
134                                         },
135                                         {
136                                             "height": 30,
137                                             "hideLabels": true,
138                                             "style": "margin-left:155px;",
139                                             "xtype": "Row",
140                                             "|xns": "Roo.form",
141                                             "items": [
142                                                 {
143                                                     "name": "salesaccnt_sales_accnt_id_descrip",
144                                                     "width": 200,
145                                                     "xtype": "DisplayField",
146                                                     "|xns": "Roo.form"
147                                                 }
148                                             ]
149                                         },
150                                         {
151                                             "labelWidth": 150,
152                                             "xtype": "Row",
153                                             "|xns": "Roo.form",
154                                             "items": [
155                                                 {
156                                                     "listeners": {
157                                                         "beforeselect": "function (combo, record, index)\n{\n    _this.form.findField('salesaccnt_credit_accnt_id_descrip').setValue(record.data.accnt_descrip);\n}"
158                                                     },
159                                                     "allowBlank": false,
160                                                     "displayField": "accnt_name",
161                                                     "editable": true,
162                                                     "emptyText": "Select Account",
163                                                     "fieldLabel": "Credit Memo Account",
164                                                     "forceSelection": true,
165                                                     "hiddenName": "salesaccnt_credit_accnt_id",
166                                                     "listWidth": 400,
167                                                     "loadingText": "Searching...",
168                                                     "minChars": 2,
169                                                     "name": "salesaccnt_credit_accnt_id_name",
170                                                     "pageSize": 20,
171                                                     "qtip": "Select Account",
172                                                     "queryParam": "search[name]",
173                                                     "selectOnFocus": true,
174                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{accnt_name} ( {accnt_descrip} )</b> </div>",
175                                                     "triggerAction": "all",
176                                                     "typeAhead": true,
177                                                     "valueField": "accnt_id",
178                                                     "width": 200,
179                                                     "xtype": "ComboBox",
180                                                     "|xns": "Roo.form",
181                                                     "items": [
182                                                         {
183                                                             "listeners": {
184                                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.accnt_active = 1;\n    o.params.accnt_type = 'R';\n}\n"
185                                                             },
186                                                             "*prop": "store",
187                                                             "remoteSort": true,
188                                                             "xtype": "Store",
189                                                             "|sortInfo": "{ direction : 'ASC', field: 'accnt_id' }",
190                                                             "|xns": "Roo.data",
191                                                             "items": [
192                                                                 {
193                                                                     "*prop": "proxy",
194                                                                     "method": "GET",
195                                                                     "xtype": "HttpProxy",
196                                                                     "|url": "baseURL + '/Roo/accnt.php'",
197                                                                     "|xns": "Roo.data"
198                                                                 },
199                                                                 {
200                                                                     "*prop": "reader",
201                                                                     "id": "accnt_id",
202                                                                     "root": "data",
203                                                                     "totalProperty": "total",
204                                                                     "xtype": "JsonReader",
205                                                                     "|fields": "[{\"name\":\"accnt_id\",\"type\":\"int\"},{\"name\":\"accnt_descrip\",\"type\":\"string\"}]",
206                                                                     "|xns": "Roo.data"
207                                                                 }
208                                                             ]
209                                                         }
210                                                     ]
211                                                 }
212                                             ]
213                                         },
214                                         {
215                                             "height": 30,
216                                             "hideLabels": true,
217                                             "style": "margin-left:155px;",
218                                             "xtype": "Row",
219                                             "|xns": "Roo.form",
220                                             "items": [
221                                                 {
222                                                     "name": "salesaccnt_credit_accnt_id_descrip",
223                                                     "width": 200,
224                                                     "xtype": "DisplayField",
225                                                     "|xns": "Roo.form"
226                                                 }
227                                             ]
228                                         },
229                                         {
230                                             "labelWidth": 150,
231                                             "xtype": "Row",
232                                             "|xns": "Roo.form",
233                                             "items": [
234                                                 {
235                                                     "listeners": {
236                                                         "beforeselect": "function (combo, record, index)\n{\n    _this.form.findField('salesaccnt_cos_accnt_id_descrip').setValue(record.data.accnt_descrip);\n}"
237                                                     },
238                                                     "allowBlank": false,
239                                                     "displayField": "accnt_name",
240                                                     "editable": true,
241                                                     "emptyText": "Select Account",
242                                                     "fieldLabel": "Cost of Sales Account",
243                                                     "forceSelection": true,
244                                                     "hiddenName": "salesaccnt_cos_accnt_id",
245                                                     "listWidth": 400,
246                                                     "loadingText": "Searching...",
247                                                     "minChars": 2,
248                                                     "name": "salesaccnt_cos_accnt_id_name",
249                                                     "pageSize": 20,
250                                                     "qtip": "Select Account",
251                                                     "queryParam": "search[name]",
252                                                     "selectOnFocus": true,
253                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{accnt_name} ( {accnt_descrip} )</b> </div>",
254                                                     "triggerAction": "all",
255                                                     "typeAhead": true,
256                                                     "valueField": "accnt_id",
257                                                     "width": 200,
258                                                     "xtype": "ComboBox",
259                                                     "|xns": "Roo.form",
260                                                     "items": [
261                                                         {
262                                                             "listeners": {
263                                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.accnt_active = 1;\n    o.params.accnt_type = 'E';\n}\n"
264                                                             },
265                                                             "*prop": "store",
266                                                             "remoteSort": true,
267                                                             "xtype": "Store",
268                                                             "|sortInfo": "{ direction : 'ASC', field: 'accnt_id' }",
269                                                             "|xns": "Roo.data",
270                                                             "items": [
271                                                                 {
272                                                                     "*prop": "proxy",
273                                                                     "method": "GET",
274                                                                     "xtype": "HttpProxy",
275                                                                     "|url": "baseURL + '/Roo/accnt.php'",
276                                                                     "|xns": "Roo.data"
277                                                                 },
278                                                                 {
279                                                                     "*prop": "reader",
280                                                                     "id": "accnt_id",
281                                                                     "root": "data",
282                                                                     "totalProperty": "total",
283                                                                     "xtype": "JsonReader",
284                                                                     "|fields": "[{\"name\":\"accnt_id\",\"type\":\"int\"},{\"name\":\"accnt_descrip\",\"type\":\"string\"}]",
285                                                                     "|xns": "Roo.data"
286                                                                 }
287                                                             ]
288                                                         }
289                                                     ]
290                                                 }
291                                             ]
292                                         },
293                                         {
294                                             "height": 30,
295                                             "hideLabels": true,
296                                             "style": "margin-left:155px;",
297                                             "xtype": "Row",
298                                             "|xns": "Roo.form",
299                                             "items": [
300                                                 {
301                                                     "name": "salesaccnt_cos_accnt_id_descrip",
302                                                     "width": 200,
303                                                     "xtype": "DisplayField",
304                                                     "|xns": "Roo.form"
305                                                 }
306                                             ]
307                                         }
308                                     ]
309                                 },
310                                 {
311                                     "name": "prodcat_id",
312                                     "xtype": "Hidden",
313                                     "|xns": "Roo.form"
314                                 },
315                                 {
316                                     "name": "salesaccnt_id",
317                                     "xtype": "Hidden",
318                                     "|xns": "Roo.form"
319                                 }
320                             ]
321                         }
322                     ]
323                 },
324                 {
325                     "listeners": {
326                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
327                     },
328                     "*prop": "buttons[]",
329                     "text": "Cancel",
330                     "xtype": "Button",
331                     "|xns": "Roo"
332                 },
333                 {
334                     "listeners": {
335                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n   // _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
336                     },
337                     "*prop": "buttons[]",
338                     "text": "Save",
339                     "xtype": "Button",
340                     "|xns": "Roo"
341                 }
342             ]
343         }
344     ],
345     "permname": "",
346     "modOrder": "001"
347 }