Pman.Dialog.XtupleItem.bjs
[Pman.Xtuple] / Pman.Dialog.XtupleItem.bjs
1 {
2     "name" : "Pman.Dialog.XtupleItem",
3     "parent" : "",
4     "title" : "",
5     "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleItem.bjs",
6     "permname" : "",
7     "modOrder" : "001",
8     "items" : [
9         {
10             "listeners" : {
11                 "show" : "function (_self)\n{\n     _this.dialog.layout.getRegion('center').showPanel(0);\n}"
12             },
13             "modal" : true,
14             "collapsible" : false,
15             "title" : "Edit / Create item",
16             "xtype" : "LayoutDialog",
17             "width" : 800,
18             "$ xns" : "Roo",
19             "closable" : false,
20             "resizable" : false,
21             "height" : 550,
22             "items" : [
23                 {
24                     "alwaysShowTabs" : true,
25                     "xtype" : "LayoutRegion",
26                     "tabPosition" : "top",
27                     "$ xns" : "Roo",
28                     "* prop" : "center"
29                 },
30                 {
31                     "region" : "center",
32                     "title" : "Detail",
33                     "xtype" : "ContentPanel",
34                     "$ xns" : "Roo",
35                     "items" : [
36                         {
37                             "listeners" : {
38                                 "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       _this.form.findField('item_number').el.dom.readOnly = true;\n       _this.form.findField('item_type').disabled = true; \n       \n       if(_this.data.item_id * 1 > 0){\n            \n            this.load({ \n                method: 'GET', \n                params: {\n                     '_id' : _this.data.item_id,\n                     '_with_itemsite' : 1,\n                     '_with_itemcost' : 1,\n                     '_with_prodcat' : 1 ,\n                     '_with_salesaccnt' : 1 \n                }\n            });\n            return;\n       }\n       // if it's new..\n       _this.form.findField('item_number').el.dom.readOnly = false;\n       _this.form.findField('item_type').disabled = false; \n       _this.form.findField('item_salesaccnt').setValue('');\n       \n       return;\n    }\n    if (action.type == 'load') {\n       _this.form.findField('item_type').showHide();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        var id = _this.form.findField('item_id').getValue() * 1;\n        if (id < 1) {\n        \n            this.load({ \n                method: 'GET', \n                params: {\n                     '_id' : action.result.data.item_id,\n                     '_with_itemsite' : 1,\n                     '_with_itemcost' : 1,\n                     '_with_prodcat' : 1 ,\n                     '_with_salesaccnt' : 1 \n                }\n            });\n            return;\n        }\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",
39                                 "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
40                             },
41                             "$ url" : "baseURL + '/Roo/item.php'",
42                             "method" : "POST",
43                             "style" : "margin:10px;",
44                             "xtype" : "Form",
45                             "labelWidth" : 120,
46                             "$ xns" : "Roo.form",
47                             "items" : [
48                                 {
49                                     "fieldLabel" : "SKU",
50                                     "xtype" : "TextField",
51                                     "allowBlank" : false,
52                                     "width" : 200,
53                                     "$ xns" : "Roo.form",
54                                     "name" : "item_number"
55                                 },
56                                 {
57                                     "fieldLabel" : "Description",
58                                     "xtype" : "TextField",
59                                     "width" : 400,
60                                     "$ xns" : "Roo.form",
61                                     "name" : "item_descrip1"
62                                 },
63                                 {
64                                     "fieldLabel" : "Description (2)",
65                                     "xtype" : "TextField",
66                                     "width" : 400,
67                                     "$ xns" : "Roo.form",
68                                     "name" : "item_descrip2"
69                                 },
70                                 {
71                                     "xtype" : "Column",
72                                     "labelWidth" : 120,
73                                     "$ xns" : "Roo.form",
74                                     "items" : [
75                                         {
76                                             "listeners" : {
77                                                 "beforeselect" : "function (combo, record, index)\n{\n    (function() { combo.showHide(); }).defer(100);\n}"
78                                             },
79                                             "listWidth" : 200,
80                                             "triggerAction" : "all",
81                                             "fieldLabel" : "Type",
82                                             "displayField" : "fname",
83                                             "emptyText" : "Select Type",
84                                             "hiddenName" : "item_type",
85                                             "valueField" : "ftype",
86                                             "xtype" : "ComboBox",
87                                             "allowBlank" : false,
88                                             "$ showHide" : "function() {\n\n    var it = this.getValue();\n    \n    var options = [ \n        'item_itemcost_id_itemcost_curr_id',\n        'item_itemcost_id_itemcost_actcost',\n        'item_itemsite_id_itemsite_reorderlevel',\n        'item_itemsite_id_itemsite_leadtime',\n        'item_itemsite_id_itemsite_location_id',\n        'item_itemsite_id_itemsite_loccntrl',\n        'item_itemsite_id_itemsite_stocked',\n        'item_itemsite_id_itemsite_perishable',\n        \n        'item_itemsite_id_itemsite_safetystock',\n        'item_itemsite_id_itemsite_controlmethod',\n        'item_itemsite_id_itemsite_plancode_id',\n        'item_itemsite_id_itemsite_costcat_id',\n        'item_itemsite_id_itemsite_active',\n        'item_itemsite_id_itemsite_sold'\n        \n    ];\n    \n    var r_req = [ \n        'item_listprice'\n    ];\n    \n    var state = true;\n    \n    _this.standardCostFieldSet.show();\n    _this.itemsiteFieldSet.show();\n    _this.form.findField('_update_related').setValue(1);\n    \n    switch(it) {\n        case 'K':\n            state = false;\n\n            _this.form.findField('item_listprice').allowBlank = false;\n            _this.form.findField('item_listprice').actionMode = 'fieldEl';\n            _this.form.findField('item_listprice').hideMode = 'display';\n            _this.form.findField('item_listprice').show();\n                        \n            break;\n            \n        case 'R': // refrence\n            options = options.concat(r_req);\n            state = false;\n            _this.standardCostFieldSet.hide();\n            break;\n            \n        case 'P': // purchased..\n            options = options.concat(r_req);\n            // must have\n            break;\n    }\n    \n    Roo.each(options, function(n) {\n        var ff = _this.form.findField(n);\n        ff.allowBlank = !state;\n        ff.actionMode = 'fieldEl';\n        ff.hideMode = 'display';\n        state ? ff.show() : ff.hide(); \n        \n    });\n    \n    \n    if(!state){\n        _this.standardCostFieldSet.hide();\n        _this.itemsiteFieldSet.hide();\n        _this.form.findField('_update_related').setValue(0);\n    }\n    \n  \n           \n}\n",
89                                             "editable" : false,
90                                             "width" : 200,
91                                             "$ xns" : "Roo.form",
92                                             "mode" : "local",
93                                             "name" : "item_type_name",
94                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
95                                             "items" : [
96                                                 {
97                                                     "xtype" : "SimpleStore",
98                                                     "$ data" : "[ \n    [ 'P', \"Purchased (eg. a standard product)\"],\n    [ 'R' , \"Reference (Non-Product)\"],\n    [ 'K', \"Kit (made up of products)\"]  \n]\n",
99                                                     "$ fields" : "[  'ftype', 'fname']",
100                                                     "$ xns" : "Roo.data",
101                                                     "* prop" : "store"
102                                                 }
103                                             ]
104                                         },
105                                         {
106                                             "listWidth" : 400,
107                                             "triggerAction" : "all",
108                                             "fieldLabel" : "Class",
109                                             "forceSelection" : true,
110                                             "selectOnFocus" : true,
111                                             "pageSize" : 20,
112                                             "displayField" : "classcode_code",
113                                             "emptyText" : "Select classcode",
114                                             "hiddenName" : "item_classcode_id",
115                                             "minChars" : 2,
116                                             "valueField" : "classcode_id",
117                                             "xtype" : "ComboBox",
118                                             "allowBlank" : false,
119                                             "typeAhead" : true,
120                                             "editable" : false,
121                                             "width" : 200,
122                                             "$ xns" : "Roo.form",
123                                             "name" : "item_classcode_id_classcode_code",
124                                             "qtip" : "Select classcode",
125                                             "queryParam" : "",
126                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>",
127                                             "loadingText" : "Searching...",
128                                             "items" : [
129                                                 {
130                                                     "listeners" : {
131                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
132                                                     },
133                                                     "xtype" : "Store",
134                                                     "remoteSort" : true,
135                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
136                                                     "$ xns" : "Roo.data",
137                                                     "* prop" : "store",
138                                                     "items" : [
139                                                         {
140                                                             "$ url" : "baseURL + '/Roo/classcode.php'",
141                                                             "xtype" : "HttpProxy",
142                                                             "method" : "GET",
143                                                             "$ xns" : "Roo.data",
144                                                             "* prop" : "proxy"
145                                                         },
146                                                         {
147                                                             "id" : "id",
148                                                             "root" : "data",
149                                                             "xtype" : "JsonReader",
150                                                             "$ xns" : "Roo.data",
151                                                             "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"classcode_code\",\"type\":\"string\"}]",
152                                                             "* prop" : "reader",
153                                                             "totalProperty" : "total"
154                                                         }
155                                                     ]
156                                                 }
157                                             ]
158                                         },
159                                         {
160                                             "fieldLabel" : "Weight",
161                                             "xtype" : "NumberField",
162                                             "allowBlank" : false,
163                                             "allowDecimals" : true,
164                                             "decimalPrecision" : 2,
165                                             "width" : 200,
166                                             "$ xns" : "Roo.form",
167                                             "name" : "item_prodweight"
168                                         },
169                                         {
170                                             "fieldLabel" : "Item comments",
171                                             "xtype" : "TextArea",
172                                             "width" : 200,
173                                             "$ xns" : "Roo.form",
174                                             "name" : "item_comments",
175                                             "height" : 100
176                                         },
177                                         {
178                                             "fieldLabel" : "Item sold",
179                                             "inputValue" : true,
180                                             "xtype" : "Checkbox",
181                                             "valueOff" : 0,
182                                             "width" : 75,
183                                             "$ xns" : "Roo.form",
184                                             "name" : "item_sold"
185                                         },
186                                         {
187                                             "fieldLabel" : "Item active",
188                                             "inputValue" : true,
189                                             "xtype" : "Checkbox",
190                                             "valueOff" : 0,
191                                             "width" : 75,
192                                             "$ xns" : "Roo.form",
193                                             "name" : "item_active"
194                                         },
195                                         {
196                                             "listeners" : {
197                                                 "add" : "function (combo)\n{\n    Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});\n}",
198                                                 "edit" : "function (combo, record)\n{\n    var s = _this.form.findField('item_prodcat_id').getValue() * 1;\n    if(s < 1){\n        Roo.MessageBox.alert('Error','Please select a account assignment');\n        return;\n    }\n    Pman.Dialog.XtupleProdcat.show({prodcat_id : s});\n}"
199                                             },
200                                             "alwaysQuery" : true,
201                                             "listWidth" : 400,
202                                             "triggerAction" : "all",
203                                             "fieldLabel" : "Product Category",
204                                             "forceSelection" : true,
205                                             "selectOnFocus" : true,
206                                             "pageSize" : 20,
207                                             "displayField" : "prodcat_code",
208                                             "emptyText" : "Select Category",
209                                             "hiddenName" : "item_prodcat_id",
210                                             "minChars" : 2,
211                                             "valueField" : "prodcat_id",
212                                             "xtype" : "ComboBox",
213                                             "allowBlank" : false,
214                                             "typeAhead" : true,
215                                             "editable" : false,
216                                             "width" : 200,
217                                             "$ xns" : "Roo.form",
218                                             "name" : "item_prodcat_id_prodcat_code",
219                                             "qtip" : "Select prodcat",
220                                             "queryParam" : "",
221                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>",
222                                             "loadingText" : "Searching...",
223                                             "items" : [
224                                                 {
225                                                     "listeners" : {
226                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
227                                                     },
228                                                     "xtype" : "Store",
229                                                     "remoteSort" : true,
230                                                     "$ xns" : "Roo.data",
231                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
232                                                     "* prop" : "store",
233                                                     "items" : [
234                                                         {
235                                                             "$ url" : "baseURL + '/Roo/prodcat.php'",
236                                                             "xtype" : "HttpProxy",
237                                                             "method" : "GET",
238                                                             "$ xns" : "Roo.data",
239                                                             "* prop" : "proxy"
240                                                         },
241                                                         {
242                                                             "id" : "id",
243                                                             "root" : "data",
244                                                             "xtype" : "JsonReader",
245                                                             "$ xns" : "Roo.data",
246                                                             "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"prodcat_code\",\"type\":\"string\"}]",
247                                                             "* prop" : "reader",
248                                                             "totalProperty" : "total"
249                                                         }
250                                                     ]
251                                                 }
252                                             ]
253                                         },
254                                         {
255                                             "fieldLabel" : "Sales Account",
256                                             "xtype" : "DisplayField",
257                                             "$ xns" : "Roo.form",
258                                             "name" : "item_salesaccnt"
259                                         },
260                                         {
261                                             "fieldLabel" : "Item listprice",
262                                             "xtype" : "NumberField",
263                                             "width" : 200,
264                                             "$ xns" : "Roo.form",
265                                             "name" : "item_listprice"
266                                         },
267                                         {
268                                             "listeners" : {
269                                                 "render" : "function (_self)\n{\n    _this.standardCostFieldSet = _self;\n}"
270                                             },
271                                             "style" : "width:320px",
272                                             "xtype" : "FieldSet",
273                                             "legend" : "Standard Cost",
274                                             "$ xns" : "Roo.form",
275                                             "items" : [
276                                                 {
277                                                     "listWidth" : 400,
278                                                     "triggerAction" : "all",
279                                                     "fieldLabel" : "Currency",
280                                                     "forceSelection" : true,
281                                                     "selectOnFocus" : true,
282                                                     "pageSize" : 20,
283                                                     "displayField" : "curr_name",
284                                                     "emptyText" : "Select Currency",
285                                                     "hiddenName" : "item_itemcost_id_itemcost_curr_id",
286                                                     "minChars" : 2,
287                                                     "valueField" : "curr_id",
288                                                     "xtype" : "ComboBox",
289                                                     "allowBlank" : false,
290                                                     "typeAhead" : true,
291                                                     "editable" : false,
292                                                     "width" : 200,
293                                                     "$ xns" : "Roo.form",
294                                                     "name" : "curr_name",
295                                                     "qtip" : "Select Currency",
296                                                     "queryParam" : "query[curr_name]",
297                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
298                                                     "loadingText" : "Searching...",
299                                                     "items" : [
300                                                         {
301                                                             "listeners" : {
302                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   \n}\n"
303                                                             },
304                                                             "xtype" : "Store",
305                                                             "remoteSort" : true,
306                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'curr_symbol' }",
307                                                             "$ xns" : "Roo.data",
308                                                             "* prop" : "store",
309                                                             "items" : [
310                                                                 {
311                                                                     "$ url" : "baseURL + '/Roo/curr_symbol.php'",
312                                                                     "xtype" : "HttpProxy",
313                                                                     "method" : "GET",
314                                                                     "$ xns" : "Roo.data",
315                                                                     "* prop" : "proxy"
316                                                                 },
317                                                                 {
318                                                                     "id" : "curr_id",
319                                                                     "root" : "data",
320                                                                     "xtype" : "JsonReader",
321                                                                     "$ xns" : "Roo.data",
322                                                                     "$ fields" : "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]",
323                                                                     "* prop" : "reader",
324                                                                     "totalProperty" : "total"
325                                                                 }
326                                                             ]
327                                                         }
328                                                     ]
329                                                 },
330                                                 {
331                                                     "fieldLabel" : "Value",
332                                                     "xtype" : "NumberField",
333                                                     "allowBlank" : false,
334                                                     "width" : 200,
335                                                     "$ xns" : "Roo.form",
336                                                     "name" : "item_itemcost_id_itemcost_actcost"
337                                                 }
338                                             ]
339                                         }
340                                     ]
341                                 },
342                                 {
343                                     "xtype" : "Column",
344                                     "$ xns" : "Roo.form",
345                                     "items" : [
346                                         {
347                                             "listeners" : {
348                                                 "render" : "function (_self)\n{\n    _this.itemsiteFieldSet = _self;\n}"
349                                             },
350                                             "xtype" : "FieldSet",
351                                             "legend" : "Itemsite Settings",
352                                             "$ xns" : "Roo.form",
353                                             "String/Object/Function style" : "width:335px;",
354                                             "Number labelWidth" : 120,
355                                             "items" : [
356                                                 {
357                                                     "fieldLabel" : "Reorder Level",
358                                                     "xtype" : "NumberField",
359                                                     "allowBlank" : false,
360                                                     "width" : 200,
361                                                     "$ xns" : "Roo.form",
362                                                     "name" : "item_itemsite_id_itemsite_reorderlevel"
363                                                 },
364                                                 {
365                                                     "fieldLabel" : "Stock Safety Level",
366                                                     "xtype" : "NumberField",
367                                                     "allowBlank" : false,
368                                                     "width" : 200,
369                                                     "$ xns" : "Roo.form",
370                                                     "name" : "item_itemsite_id_itemsite_safetystock"
371                                                 },
372                                                 {
373                                                     "fieldLabel" : "Lead time (Days)",
374                                                     "xtype" : "NumberField",
375                                                     "allowBlank" : false,
376                                                     "width" : 200,
377                                                     "$ xns" : "Roo.form",
378                                                     "name" : "item_itemsite_id_itemsite_leadtime"
379                                                 },
380                                                 {
381                                                     "listWidth" : 200,
382                                                     "triggerAction" : "all",
383                                                     "fieldLabel" : "Control Method",
384                                                     "displayField" : "fname",
385                                                     "hiddenName" : "item_itemsite_id_itemsite_controlmethod",
386                                                     "valueField" : "ftype",
387                                                     "xtype" : "ComboBox",
388                                                     "allowBlank" : false,
389                                                     "editable" : false,
390                                                     "width" : 200,
391                                                     "$ xns" : "Roo.form",
392                                                     "mode" : "local",
393                                                     "name" : "item_itemsite_id_itemsite_controlmethod_name",
394                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
395                                                     "items" : [
396                                                         {
397                                                             "xtype" : "SimpleStore",
398                                                             "$ data" : "[ \n    [ 'N', \"None\"],\n    [ 'R' , \"Regular\"]\n]\n",
399                                                             "$ fields" : "[  'ftype', 'fname']",
400                                                             "$ xns" : "Roo.data",
401                                                             "* prop" : "store"
402                                                         }
403                                                     ]
404                                                 },
405                                                 {
406                                                     "listWidth" : 400,
407                                                     "triggerAction" : "all",
408                                                     "fieldLabel" : "Planner Code",
409                                                     "forceSelection" : true,
410                                                     "selectOnFocus" : true,
411                                                     "pageSize" : 20,
412                                                     "displayField" : "plancode_name",
413                                                     "emptyText" : "Select plancode",
414                                                     "hiddenName" : "item_itemsite_id_itemsite_plancode_id",
415                                                     "minChars" : 2,
416                                                     "valueField" : "plancode_id",
417                                                     "xtype" : "ComboBox",
418                                                     "allowBlank" : false,
419                                                     "typeAhead" : true,
420                                                     "editable" : false,
421                                                     "width" : 200,
422                                                     "$ xns" : "Roo.form",
423                                                     "name" : "plancode_name",
424                                                     "qtip" : "Select plancode",
425                                                     "queryParam" : "",
426                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>",
427                                                     "loadingText" : "Searching...",
428                                                     "items" : [
429                                                         {
430                                                             "listeners" : {
431                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
432                                                             },
433                                                             "xtype" : "Store",
434                                                             "remoteSort" : true,
435                                                             "$ xns" : "Roo.data",
436                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
437                                                             "* prop" : "store",
438                                                             "items" : [
439                                                                 {
440                                                                     "$ url" : "baseURL + '/Roo/plancode.php'",
441                                                                     "xtype" : "HttpProxy",
442                                                                     "method" : "GET",
443                                                                     "$ xns" : "Roo.data",
444                                                                     "* prop" : "proxy"
445                                                                 },
446                                                                 {
447                                                                     "id" : "id",
448                                                                     "root" : "data",
449                                                                     "xtype" : "JsonReader",
450                                                                     "$ xns" : "Roo.data",
451                                                                     "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"plancode_code\",\"type\":\"string\"}]",
452                                                                     "* prop" : "reader",
453                                                                     "totalProperty" : "total"
454                                                                 }
455                                                             ]
456                                                         }
457                                                     ]
458                                                 },
459                                                 {
460                                                     "listWidth" : 400,
461                                                     "triggerAction" : "all",
462                                                     "fieldLabel" : "Costcat",
463                                                     "forceSelection" : true,
464                                                     "selectOnFocus" : true,
465                                                     "pageSize" : 20,
466                                                     "displayField" : "costcat_code",
467                                                     "emptyText" : "Select costcat",
468                                                     "hiddenName" : "item_itemsite_id_itemsite_costcat_id",
469                                                     "minChars" : 2,
470                                                     "valueField" : "costcat_id",
471                                                     "xtype" : "ComboBox",
472                                                     "allowBlank" : false,
473                                                     "typeAhead" : true,
474                                                     "editable" : false,
475                                                     "width" : 200,
476                                                     "$ xns" : "Roo.form",
477                                                     "name" : "costcat_code",
478                                                     "qtip" : "Select costcat",
479                                                     "queryParam" : "",
480                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>",
481                                                     "loadingText" : "Searching...",
482                                                     "items" : [
483                                                         {
484                                                             "listeners" : {
485                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
486                                                             },
487                                                             "xtype" : "Store",
488                                                             "remoteSort" : true,
489                                                             "$ xns" : "Roo.data",
490                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
491                                                             "* prop" : "store",
492                                                             "items" : [
493                                                                 {
494                                                                     "$ url" : "baseURL + '/Roo/costcat.php'",
495                                                                     "xtype" : "HttpProxy",
496                                                                     "method" : "GET",
497                                                                     "$ xns" : "Roo.data",
498                                                                     "* prop" : "proxy"
499                                                                 },
500                                                                 {
501                                                                     "id" : "id",
502                                                                     "root" : "data",
503                                                                     "xtype" : "JsonReader",
504                                                                     "$ xns" : "Roo.data",
505                                                                     "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"costcat_code\",\"type\":\"string\"}]",
506                                                                     "* prop" : "reader",
507                                                                     "totalProperty" : "total"
508                                                                 }
509                                                             ]
510                                                         }
511                                                     ]
512                                                 },
513                                                 {
514                                                     "fieldLabel" : "Active",
515                                                     "inputValue" : true,
516                                                     "xtype" : "Checkbox",
517                                                     "valueOff" : 0,
518                                                     "width" : 75,
519                                                     "$ xns" : "Roo.form",
520                                                     "name" : "item_itemsite_id_itemsite_active"
521                                                 },
522                                                 {
523                                                     "fieldLabel" : "Sold",
524                                                     "inputValue" : true,
525                                                     "xtype" : "Checkbox",
526                                                     "valueOff" : 0,
527                                                     "width" : 75,
528                                                     "$ xns" : "Roo.form",
529                                                     "name" : "item_itemsite_id_itemsite_sold"
530                                                 },
531                                                 {
532                                                     "fieldLabel" : "Stocked",
533                                                     "inputValue" : true,
534                                                     "xtype" : "Checkbox",
535                                                     "valueOff" : 0,
536                                                     "width" : 75,
537                                                     "$ xns" : "Roo.form",
538                                                     "name" : "item_itemsite_id_itemsite_stocked"
539                                                 },
540                                                 {
541                                                     "fieldLabel" : "Perishable",
542                                                     "inputValue" : true,
543                                                     "xtype" : "Checkbox",
544                                                     "valueOff" : 0,
545                                                     "width" : 75,
546                                                     "$ xns" : "Roo.form",
547                                                     "name" : "item_itemsite_id_itemsite_perishable"
548                                                 },
549                                                 {
550                                                     "fieldLabel" : "Multi Location",
551                                                     "inputValue" : true,
552                                                     "xtype" : "Checkbox",
553                                                     "valueOff" : 0,
554                                                     "width" : 100,
555                                                     "$ xns" : "Roo.form",
556                                                     "name" : "item_itemsite_id_itemsite_loccntrl"
557                                                 },
558                                                 {
559                                                     "listWidth" : 400,
560                                                     "triggerAction" : "all",
561                                                     "fieldLabel" : "Default Location",
562                                                     "forceSelection" : true,
563                                                     "selectOnFocus" : true,
564                                                     "pageSize" : 200,
565                                                     "displayField" : "location_name",
566                                                     "emptyText" : "Default Location",
567                                                     "hiddenName" : "item_itemsite_id_itemsite_location_id",
568                                                     "minChars" : 2,
569                                                     "valueField" : "location_id",
570                                                     "xtype" : "ComboBox",
571                                                     "allowBlank" : false,
572                                                     "typeAhead" : false,
573                                                     "editable" : true,
574                                                     "width" : 200,
575                                                     "$ xns" : "Roo.form",
576                                                     "name" : "location_name",
577                                                     "qtip" : "Select terms",
578                                                     "queryParam" : "query[location_name]",
579                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
580                                                     "loadingText" : "Searching...",
581                                                     "items" : [
582                                                         {
583                                                             "listeners" : {
584                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n     o.params.location_netable = 1;\n     o.params._notinternalcompany = 1;\n     o.params.location_restrict = 0;\n}\n"
585                                                             },
586                                                             "xtype" : "Store",
587                                                             "remoteSort" : true,
588                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'location_name' }",
589                                                             "$ xns" : "Roo.data",
590                                                             "* prop" : "store",
591                                                             "items" : [
592                                                                 {
593                                                                     "$ url" : "baseURL + '/Roo/location.php'",
594                                                                     "method" : "GET",
595                                                                     "xtype" : "HttpProxy",
596                                                                     "$ xns" : "Roo.data",
597                                                                     "* prop" : "proxy"
598                                                                 },
599                                                                 {
600                                                                     "id" : "location_id",
601                                                                     "root" : "data",
602                                                                     "xtype" : "JsonReader",
603                                                                     "$ fields" : "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
604                                                                     "$ xns" : "Roo.data",
605                                                                     "* prop" : "reader",
606                                                                     "totalProperty" : "total"
607                                                                 }
608                                                             ]
609                                                         }
610                                                     ]
611                                                 }
612                                             ]
613                                         }
614                                     ]
615                                 },
616                                 {
617                                     "xtype" : "Hidden",
618                                     "$ xns" : "Roo.form",
619                                     "width" : 75,
620                                     "name" : "item_id"
621                                 },
622                                 {
623                                     "value" : 1,
624                                     "xtype" : "Hidden",
625                                     "width" : 75,
626                                     "$ xns" : "Roo.form",
627                                     "name" : "_update_related"
628                                 }
629                             ]
630                         }
631                     ]
632                 },
633                 {
634                     "listeners" : {
635                         "|activate" : "function() {\n    _this.partspanel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding parts\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    var type = _this.form.findField('item_type').getValue();\n    \n    if(!type.length || type != 'K'){\n        Roo.MessageBox.alert(\"Error\", \"Can't add parts to non-kit item\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.partsgrid) {\n        _this.partsgrid.footer.onClick('first');\n    \n     }\n}"
636                     },
637                     "background" : true,
638                     "region" : "center",
639                     "fitToframe" : true,
640                     "title" : "Item Parts",
641                     "xtype" : "GridPanel",
642                     "fitContainer" : true,
643                     "$ xns" : "Roo",
644                     "tableName" : "bomitem",
645                     "items" : [
646                         {
647                             "listeners" : {
648                                 "beforeedit" : "function (e)\n{\n    if(e.field != 'bomitem_qtyper'){\n        return false;\n    }\n    \n}",
649                                 "|render" : "function() \n{\n    _this.partsgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.partspanel.active) {\n       this.footer.onClick('first');\n    }\n}",
650                                 "afteredit" : "function (e)\n{\n    Roo.log('after');\n    Roo.log(e);\n    return false;\n    if(e.originalValue == e.value){\n        return false;\n    }\n    return false;\n    \n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if(id < 1){\n        return false;\n    }\n    \n    new Pman.Request({\n        method : 'POST',\n        url : baseURL + '/Roo/ipsiteminfo',\n        mask : 'Saving',\n        params : {\n            ipsitem_ipshead_id : e.record.data.ipshead_id,\n            ipsitem_item_id : id,\n            ipsitem_price : e.record.data.ipshead_ipsitem_price,\n            ipsitem_id : e.record.data.ipshead_ipsitem_id\n        }\n    \n    });\n        \n         \n        \n        \n}"
651                             },
652                             "autoExpandColumn" : "bomitem_item_id_item_descrip1",
653                             "xtype" : "EditorGrid",
654                             "loadMask" : true,
655                             "clicksToEdit" : 1,
656                             "$ xns" : "Roo.grid",
657                             "* prop" : "grid",
658                             "items" : [
659                                 {
660                                     "xtype" : "Toolbar",
661                                     "$ xns" : "Roo",
662                                     "* prop" : "toolbar",
663                                     "items" : [
664                                         {
665                                             "listeners" : {
666                                                 "render" : "function (_self)\n{\n    _this.partsBox = _self;\n}",
667                                                 "select" : "function (combo, record, index)\n{\n    var item_id = _this.form.findField('item_id').getValue() * 1;\n    \n    if(typeof(record) == 'undefined' || !record || record.data.id * 1 < 1 || item_id < 1){\n        return;\n    }\n    \n    var err = false;\n\n    _this.partsgrid.ds.each(function(d){\n        if(record.data.item_id == d.data.bomitem_item_id){\n            err = true;\n        }\n    });\n\n    if(err){\n        Roo.MessageBox.alert('Error', record.data.item_number + ' already exists!');\n        _this.partsBox.reset();\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/bomitem.php',\n        method : 'POST',\n        params : {\n            bomitem_parent_item_id : item_id,\n            bomitem_item_id : record.data.item_id\n        }, \n        success : function(res) {\n            _this.partsBox.reset();\n            _this.partsgrid.footer.onClick('first');\n        }\n    }); \n}"
668                                             },
669                                             "alwaysQuery" : true,
670                                             "triggerAction" : "all",
671                                             "fieldLabel" : "Item",
672                                             "forceSelection" : true,
673                                             "selectOnFocus" : true,
674                                             "pageSize" : 20,
675                                             "displayField" : "item_number",
676                                             "emptyText" : "Select item",
677                                             "minChars" : 2,
678                                             "valueField" : "id",
679                                             "xtype" : "ComboBox",
680                                             "allowBlank" : true,
681                                             "typeAhead" : true,
682                                             "editable" : true,
683                                             "width" : 200,
684                                             "$ xns" : "Roo.bootstrap",
685                                             "qtip" : "Select item",
686                                             "queryParam" : "query[number_or_name]",
687                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>",
688                                             "loadingText" : "Searching...",
689                                             "items" : [
690                                                 {
691                                                     "listeners" : {
692                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params.item_active = 1;\n    o.params['!item_type'] = 'K';\n}\n"
693                                                     },
694                                                     "xtype" : "Store",
695                                                     "remoteSort" : true,
696                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'item_number' }",
697                                                     "$ xns" : "Roo.data",
698                                                     "* prop" : "store",
699                                                     "items" : [
700                                                         {
701                                                             "$ url" : "baseURL + '/Roo/item.php'",
702                                                             "method" : "GET",
703                                                             "xtype" : "HttpProxy",
704                                                             "$ xns" : "Roo.data",
705                                                             "* prop" : "proxy"
706                                                         },
707                                                         {
708                                                             "id" : "id",
709                                                             "root" : "data",
710                                                             "xtype" : "JsonReader",
711                                                             "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"item_number\",\"type\":\"string\"}\n]",
712                                                             "$ xns" : "Roo.data",
713                                                             "* prop" : "reader",
714                                                             "totalProperty" : "total"
715                                                         }
716                                                     ]
717                                                 }
718                                             ]
719                                         },
720                                         {
721                                             "xtype" : "Fill",
722                                             "$ xns" : "Roo.Toolbar"
723                                         },
724                                         {
725                                             "listeners" : {
726                                                 "|click" : "function ()\n{\n    var sel = _this.partsgrid.getSelectionModel().getSelectedCell();\n    \n    if(!sel || !sel.length){\n        Roo.MessageBox.alert(\"Error\", \"Please select a item from below list\");\n        return;\n    }\n    \n    var d = _this.partsgrid.ds.getAt(sel[0]);      \n  \n    if(d.data.bomitem_id * 1 < 1){\n        Roo.MessageBox.alert(\"Error\", \"Invaild selection\");\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/bomitem.php',\n        method : 'POST',\n        params : {\n            _delete : d.data.bomitem_id\n        }, \n        success : function(res) {\n            _this.partsgrid.footer.onClick('first');\n        }\n    }); \n   \n}"
727                                             },
728                                             "text" : "Remove",
729                                             "xtype" : "Button",
730                                             "cls" : "x-btn-text-icon",
731                                             "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
732                                             "$ xns" : "Roo"
733                                         }
734                                     ]
735                                 },
736                                 {
737                                     "listeners" : {
738                                         "beforeload" : "function (_self, o)\n{\n   o.params = o.params || {};\n   \n   var id  = _this.form.findField('item_id').getValue() * 1;\n   if(id < 1){\n        return false;\n   }\n   \n   o.params.bom_parent_item_id = id;\n}"
739                                     },
740                                     "xtype" : "Store",
741                                     "remoteSort" : true,
742                                     "$ sortInfo" : "{ field : 'bomitem_item_id_item_name', direction: 'ASC' }",
743                                     "$ xns" : "Roo.data",
744                                     "* prop" : "dataSource",
745                                     "items" : [
746                                         {
747                                             "$ url" : "baseURL + '/Roo/bomitem.php'",
748                                             "xtype" : "HttpProxy",
749                                             "method" : "GET",
750                                             "$ xns" : "Roo.data",
751                                             "* prop" : "proxy"
752                                         },
753                                         {
754                                             "id" : "bom_id",
755                                             "root" : "data",
756                                             "xtype" : "JsonReader",
757                                             "$ fields" : "[\n    {\n        'name': 'bomitem_id',\n        'type': 'int'\n    }\n]",
758                                             "$ xns" : "Roo.data",
759                                             "* prop" : "reader",
760                                             "totalProperty" : "total"
761                                         }
762                                     ]
763                                 },
764                                 {
765                                     "pageSize" : 50,
766                                     "xtype" : "PagingToolbar",
767                                     "emptyMsg" : "Nothing found",
768                                     "$ xns" : "Roo",
769                                     "displayMsg" : "Displaying parts {0} - {1} of {2}",
770                                     "displayInfo" : true,
771                                     "* prop" : "footer"
772                                 },
773                                 {
774                                     "xtype" : "ColumnModel",
775                                     "header" : "Name",
776                                     "width" : 150,
777                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
778                                     "$ xns" : "Roo.grid",
779                                     "* prop" : "colModel[]",
780                                     "dataIndex" : "bomitem_item_id_item_number"
781                                 },
782                                 {
783                                     "xtype" : "ColumnModel",
784                                     "header" : "Description",
785                                     "width" : 150,
786                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
787                                     "$ xns" : "Roo.grid",
788                                     "* prop" : "colModel[]",
789                                     "dataIndex" : "bomitem_item_id_item_descrip1"
790                                 },
791                                 {
792                                     "xtype" : "ColumnModel",
793                                     "String align" : "right",
794                                     "header" : "Qty",
795                                     "width" : 100,
796                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
797                                     "$ xns" : "Roo.grid",
798                                     "* prop" : "colModel[]",
799                                     "dataIndex" : "bomitem_qtyper",
800                                     "items" : [
801                                         {
802                                             "xtype" : "GridEditor",
803                                             "$ xns" : "Roo.grid",
804                                             "* prop" : "editor",
805                                             "items" : [
806                                                 {
807                                                     "Boolean allowBlank" : false,
808                                                     "String cls" : "align-right",
809                                                     "xtype" : "NumberField",
810                                                     "Number decimalPrecision" : 0,
811                                                     "$ xns" : "Roo.form",
812                                                     "* prop" : "field",
813                                                     "Number minValue" : 0
814                                                 }
815                                             ]
816                                         }
817                                     ]
818                                 }
819                             ]
820                         }
821                     ]
822                 },
823                 {
824                     "listeners" : {
825                         "|activate" : "function() {\n    _this.panel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding image\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    \n     }\n}"
826                     },
827                     "region" : "center",
828                     "fitToframe" : true,
829                     "background" : true,
830                     "title" : "Reference Files",
831                     "xtype" : "GridPanel",
832                     "fitContainer" : true,
833                     "$ xns" : "Roo",
834                     "tableName" : "Images",
835                     "items" : [
836                         {
837                             "listeners" : {
838                                 "|rowdblclick" : "function (_self, rowIndex, e)\n{\n  \n   var s =  _self.getDataSource().getAt(rowIndex);\n   new Pman.Download({\n        url : baseURL + '/Images/Download/' + s.data.id\n    });\n   \n}",
839                                 "|render" : "function() { \n    _this.grid = this; \n\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
840                             },
841                             "autoExpandColumn" : "id",
842                             "xtype" : "Grid",
843                             "loadMask" : true,
844                             "$ xns" : "Roo.grid",
845                             "* prop" : "grid",
846                             "items" : [
847                                 {
848                                     "listeners" : {
849                                         "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    var id = _this.form.findField('item_id').getValue();\n    \n    if(id * 1 < 1){\n        return false;\n    }\n    \n    o.params.onid = id;\n    o.params.ontable = 'item';\n    \n}"
850                                     },
851                                     "xtype" : "Store",
852                                     "remoteSort" : true,
853                                     "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }",
854                                     "$ xns" : "Roo.data",
855                                     "* prop" : "dataSource",
856                                     "items" : [
857                                         {
858                                             "id" : "id",
859                                             "root" : "data",
860                                             "xtype" : "JsonReader",
861                                             "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat' : 'Y-m-d H:i:s'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    }\n]",
862                                             "$ xns" : "Roo.data",
863                                             "* prop" : "reader",
864                                             "totalProperty" : "total"
865                                         },
866                                         {
867                                             "$ url" : "baseURL + '/Roo/Images.php'",
868                                             "xtype" : "HttpProxy",
869                                             "method" : "GET",
870                                             "$ xns" : "Roo.data",
871                                             "* prop" : "proxy"
872                                         }
873                                     ]
874                                 },
875                                 {
876                                     "pageSize" : 25,
877                                     "xtype" : "PagingToolbar",
878                                     "emptyMsg" : "No Images found",
879                                     "$ xns" : "Roo",
880                                     "displayInfo" : true,
881                                     "displayMsg" : "Displaying Images  {0} - {1} of {2}",
882                                     "* prop" : "footer"
883                                 },
884                                 {
885                                     "xtype" : "Toolbar",
886                                     "$ xns" : "Roo",
887                                     "* prop" : "toolbar",
888                                     "items" : [
889                                         {
890                                             "listeners" : {
891                                                 "|click" : "function()\n{\n    Pman.Dialog.Image.show({\n        id : 0, \n        ontable: 'item',\n        onid: _this.form.findField('item_id').getValue() * 1,\n        imgtype : ''\n    }, function(data){\n        if (!data) { return; } \n        _this.grid.footer.onClick('first');\n    }); \n\n}       "
892                                             },
893                                             "text" : "Add",
894                                             "xtype" : "Button",
895                                             "cls" : "x-btn-text-icon",
896                                             "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
897                                             "$ xns" : "Roo.Toolbar"
898                                         },
899                                         {
900                                             "listeners" : {
901                                                 "|click" : "function()\n{\n    Pman.genericDelete(_this, 'Images'); \n}\n        "
902                                             },
903                                             "text" : "Delete",
904                                             "xtype" : "Button",
905                                             "cls" : "x-btn-text-icon",
906                                             "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
907                                             "$ xns" : "Roo.Toolbar"
908                                         }
909                                     ]
910                                 },
911                                 {
912                                     "xtype" : "ColumnModel",
913                                     "sortable" : true,
914                                     "header" : "Created",
915                                     "width" : 200,
916                                     "$ renderer" : "function(v,x,r) {\n       return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',\n            v.format('d/M/Y'), r.data.mimetype, r.data.filename,\n    r.data.width, r.data.height\n    ); \n}\n     ",
917                                     "$ xns" : "Roo.grid",
918                                     "* prop" : "colModel[]",
919                                     "dataIndex" : "created"
920                                 },
921                                 {
922                                     "xtype" : "ColumnModel",
923                                     "width" : 100,
924                                     "header" : "Image",
925                                     "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" height=\"100\">', baseURL, v, r.data.filename); }",
926                                     "$ xns" : "Roo.grid",
927                                     "* prop" : "colModel[]",
928                                     "dataIndex" : "id"
929                                 }
930                             ]
931                         }
932                     ]
933                 },
934                 {
935                     "listeners" : {
936                         "|activate" : "function() {\n    _this.lpanel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding image\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.lgrid) {\n        _this.lgrid.footer.onClick('first');\n    \n     }\n}"
937                     },
938                     "region" : "center",
939                     "fitToframe" : true,
940                     "background" : true,
941                     "title" : "Price List",
942                     "xtype" : "GridPanel",
943                     "fitContainer" : true,
944                     "$ xns" : "Roo",
945                     "tableName" : "ipshead",
946                     "items" : [
947                         {
948                             "listeners" : {
949                                 "beforeedit" : "function (e)\n{\n    if(e.field != 'ipshead_ipsitem_price'){\n        return false;\n    }\n    \n}",
950                                 "|render" : "function() \n{\n    _this.lgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.lpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
951                                 "afteredit" : "function (e)\n{\n    if(e.originalValue == e.value){\n        return false;\n    }\n    \n    var id = _this.form.findField('item_id').getValue() * 1;\n    if(id < 1){\n        return false;\n    }\n    \n    new Pman.Request({\n        method : 'POST',\n        url : baseURL + '/Roo/ipsiteminfo',\n        mask : 'Saving',\n        params : {\n            ipsitem_ipshead_id : e.record.data.ipshead_id,\n            ipsitem_item_id : id,\n            ipsitem_price : e.record.data.ipshead_ipsitem_price,\n            ipsitem_id : e.record.data.ipshead_ipsitem_id\n        }\n    \n    });\n        \n         \n        \n        \n}"
952                             },
953                             "autoExpandColumn" : "ipshead_descrip",
954                             "xtype" : "EditorGrid",
955                             "loadMask" : true,
956                             "clicksToEdit" : 1,
957                             "$ xns" : "Roo.grid",
958                             "* prop" : "grid",
959                             "items" : [
960                                 {
961                                     "listeners" : {
962                                         "beforeload" : "function (_self, o)\n{\n   o.params = o.params || {};\n   \n   var id  = _this.form.findField('item_id').getValue() * 1;\n   if(id < 1){\n        return false;\n   }\n   \n   o.params._with_item = id;\n}"
963                                     },
964                                     "xtype" : "Store",
965                                     "remoteSort" : true,
966                                     "$ sortInfo" : "{ field : 'ipshead_id', direction: 'ASC' }",
967                                     "$ xns" : "Roo.data",
968                                     "* prop" : "dataSource",
969                                     "items" : [
970                                         {
971                                             "$ url" : "baseURL + '/Roo/ipshead.php'",
972                                             "method" : "GET",
973                                             "xtype" : "HttpProxy",
974                                             "$ xns" : "Roo.data",
975                                             "* prop" : "proxy"
976                                         },
977                                         {
978                                             "id" : "ipshead_id",
979                                             "root" : "data",
980                                             "xtype" : "JsonReader",
981                                             "$ fields" : "[\n    {\n        'name': 'ipshead_id',\n        'type': 'int'\n    },\n    {\n        'name': 'ipshead_name',\n        'type': 'string'\n    }\n]",
982                                             "$ xns" : "Roo.data",
983                                             "* prop" : "reader",
984                                             "totalProperty" : "total"
985                                         }
986                                     ]
987                                 },
988                                 {
989                                     "pageSize" : 50,
990                                     "xtype" : "PagingToolbar",
991                                     "emptyMsg" : "Nothing found",
992                                     "$ xns" : "Roo",
993                                     "displayMsg" : "Displaying records {0} - {1} of {2}",
994                                     "displayInfo" : true,
995                                     "* prop" : "footer"
996                                 },
997                                 {
998                                     "xtype" : "ColumnModel",
999                                     "width" : 150,
1000                                     "header" : "Name",
1001                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1002                                     "$ xns" : "Roo.grid",
1003                                     "* prop" : "colModel[]",
1004                                     "dataIndex" : "ipshead_name"
1005                                 },
1006                                 {
1007                                     "xtype" : "ColumnModel",
1008                                     "width" : 150,
1009                                     "header" : "Description",
1010                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1011                                     "$ xns" : "Roo.grid",
1012                                     "* prop" : "colModel[]",
1013                                     "dataIndex" : "ipshead_descrip"
1014                                 },
1015                                 {
1016                                     "xtype" : "ColumnModel",
1017                                     "width" : 100,
1018                                     "header" : "Currency",
1019                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1020                                     "$ xns" : "Roo.grid",
1021                                     "* prop" : "colModel[]",
1022                                     "dataIndex" : "ipshead_curr_id_curr_name"
1023                                 },
1024                                 {
1025                                     "align" : "right",
1026                                     "xtype" : "ColumnModel",
1027                                     "header" : "Price",
1028                                     "width" : 120,
1029                                     "$ renderer" : "function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); }",
1030                                     "$ xns" : "Roo.grid",
1031                                     "* prop" : "colModel[]",
1032                                     "dataIndex" : "ipshead_ipsitem_price",
1033                                     "items" : [
1034                                         {
1035                                             "xtype" : "GridEditor",
1036                                             "$ xns" : "Roo.grid",
1037                                             "* prop" : "editor",
1038                                             "items" : [
1039                                                 {
1040                                                     "xtype" : "NumberField",
1041                                                     "cls" : "align-right",
1042                                                     "decimalPrecision" : 2,
1043                                                     "$ xns" : "Roo.form",
1044                                                     "* prop" : "field"
1045                                                 }
1046                                             ]
1047                                         }
1048                                     ]
1049                                 }
1050                             ]
1051                         }
1052                     ]
1053                 },
1054                 {
1055                     "listeners" : {
1056                         "|activate" : "function() {\n    _this.itemsrcpanel = this;\n    if (_this.itemsrcgrid) {\n        _this.itemsrcgrid.footer.onClick('first');\n    }\n}"
1057                     },
1058                     "region" : "center",
1059                     "fitToframe" : true,
1060                     "background" : true,
1061                     "title" : "Suppliers",
1062                     "xtype" : "GridPanel",
1063                     "fitContainer" : true,
1064                     "$ xns" : "Roo",
1065                     "tableName" : "itemsrc",
1066                     "items" : [
1067                         {
1068                             "listeners" : {
1069                                 "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
1070                                 "|render" : "function() \n{\n    _this.itemsrcgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    \n}",
1071                                 "afteredit" : "function (e)\n{\n    e.record.commit();\n}"
1072                             },
1073                             "autoExpandColumn" : "itemsrc_comments",
1074                             "xtype" : "EditorGrid",
1075                             "loadMask" : true,
1076                             "clicksToEdit" : 1,
1077                             "$ xns" : "Roo.grid",
1078                             "* prop" : "grid",
1079                             "items" : [
1080                                 {
1081                                     "listeners" : {
1082                                         "update" : "function (_self, record, operation)\n{\n    Roo.log(operation);\n      Roo.log(record);\n   \n    if (operation != 'commit') {\n        return;\n    }\n    if (record.data.itemsrc_vend_id * 1 < 1) {\n        return; // do not save.\n    }\n    if (record.data.itemsrc_id * 1 < 0) {\n        return; // do not save. -- updating at present...\n    }\n    \n    var p = Roo.apply({}, record.data);\n    record.set('itemsrc_id', -1);    \n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Itemsrc',\n        params : p,\n        method : 'POST',\n        success: function(res) {\n            if (record.data.itemsrc_id *1  < 1) { \n                record.set('itemsrc_id', res.data.itemsrc_id);\n            }\n        }\n    });\n    \n    \n}",
1083                                         "beforeload" : "function (_self, o)\n{\n    \n    var id = 1 * _this.form.findField('item_id').getValue();\n    if (!id) {\n        this.removeAll();\n        return false;\n    }\n    o.params.itemsrc_item_id = id;\n}"
1084                                     },
1085                                     "xtype" : "Store",
1086                                     "remoteSort" : true,
1087                                     "$ sortInfo" : "{ field : 'itemsrc_vend_id_vend_name', direction: 'ASC' }",
1088                                     "$ xns" : "Roo.data",
1089                                     "* prop" : "dataSource",
1090                                     "items" : [
1091                                         {
1092                                             "$ url" : "baseURL + '/Roo/itemsrc.php'",
1093                                             "xtype" : "HttpProxy",
1094                                             "method" : "GET",
1095                                             "$ xns" : "Roo.data",
1096                                             "* prop" : "proxy"
1097                                         },
1098                                         {
1099                                             "id" : "id",
1100                                             "root" : "data",
1101                                             "xtype" : "JsonReader",
1102                                             "$ xns" : "Roo.data",
1103                                             "$ fields" : "[\n    {\n        'name': 'itemsrc_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_item_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_item_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_vend_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_vend_id',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_vend_item_number',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_vend_item_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_comments',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_vend_uom',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_invvendoruomratio',\n        'type': 'float'\n    },\n    {\n        'name': 'itemsrc_minordqty',\n        'type': 'float'\n    },\n    {\n        'name': 'itemsrc_multordqty',\n        'type': 'float'\n    },\n    {\n        'name': 'itemsrc_leadtime',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_ranking',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_active',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_manuf_name',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_manuf_item_number',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_manuf_item_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'itemsrc_default',\n        'type': 'int'\n    },\n    {\n        'name': 'itemsrc_upccode',\n        'type': 'string'\n    }\n]",
1104                                             "* prop" : "reader",
1105                                             "totalProperty" : "total"
1106                                         }
1107                                     ]
1108                                 },
1109                                 {
1110                                     "pageSize" : 25,
1111                                     "xtype" : "PagingToolbar",
1112                                     "emptyMsg" : "No itemsrc found",
1113                                     "$ xns" : "Roo",
1114                                     "displayInfo" : true,
1115                                     "displayMsg" : "Displaying itemsrc{0} - {1} of {2}",
1116                                     "* prop" : "footer"
1117                                 },
1118                                 {
1119                                     "xtype" : "Toolbar",
1120                                     "$ xns" : "Roo",
1121                                     "* prop" : "toolbar",
1122                                     "items" : [
1123                                         {
1124                                             "listeners" : {
1125                                                 "|click" : "function()\n{\n     \n    Roo.log(\"add presed\");\n     \n    // work out last \n    var grid = _this.itemsrcgrid;\n     \n    // uses form defaults or last row value.\n    var nr = grid.ds.reader.newRow({\n             itemsrc_id : 0,\n        itemsrc_item_id : _this.form.findField('item_id').getValue(),\n\n         itemsrc_vend_id : 0,\n         itemsrc_vend_item_number : '',\n         itemsrc_vend_item_descrip : '',\n         itemsrc_comments           : '',\n         itemsrc_vend_uom  :           'EA',\n         itemsrc_invvendoruomratio : 1.0,\n         itemsrc_minordqty        : 0,\n         itemsrc_multordqty        : 0,\n         itemsrc_leadtime         :  30,\n         itemsrc_ranking         :   0,\n         itemsrc_active          :   true,\n         itemsrc_manuf_name       :  '',\n         itemsrc_manuf_item_number : '',\n         itemsrc_manuf_item_descrip: '',\n         itemsrc_default          : true,\n         itemsrc_upccode    : ''\n                        \n    });\n    grid.stopEditing();\n    grid.ds.insert(0, nr); \n    grid.startEditing(0, 0); // type..\n\n}\n \n"
1126                                             },
1127                                             "text" : "Add",
1128                                             "xtype" : "Button",
1129                                             "cls" : "x-btn-text-icon",
1130                                             "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1131                                             "$ xns" : "Roo.Toolbar"
1132                                         }
1133                                     ]
1134                                 },
1135                                 {
1136                                     "xtype" : "ColumnModel",
1137                                     "width" : 120,
1138                                     "header" : "Vendor",
1139                                     "$ renderer" : "function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); }",
1140                                     "$ xns" : "Roo.grid",
1141                                     "* prop" : "colModel[]",
1142                                     "dataIndex" : "itemsrc_vend_id",
1143                                     "items" : [
1144                                         {
1145                                             "xtype" : "GridEditor",
1146                                             "$ xns" : "Roo.grid",
1147                                             "* prop" : "editor",
1148                                             "items" : [
1149                                                 {
1150                                                     "listWidth" : 400,
1151                                                     "triggerAction" : "all",
1152                                                     "forceSelection" : true,
1153                                                     "selectOnFocus" : true,
1154                                                     "pageSize" : 20,
1155                                                     "displayField" : "vend_name",
1156                                                     "emptyText" : "Select Vendor",
1157                                                     "hiddenName" : "itemsrc_vend_id",
1158                                                     "minChars" : 2,
1159                                                     "valueField" : "vend_id",
1160                                                     "xtype" : "ComboBox",
1161                                                     "allowBlank" : false,
1162                                                     "typeAhead" : true,
1163                                                     "editable" : true,
1164                                                     "width" : 300,
1165                                                     "$ xns" : "Roo.form",
1166                                                     "* prop" : "field",
1167                                                     "name" : "itemsrc_vend_id_vend_name",
1168                                                     "qtip" : "Select vendinfo",
1169                                                     "queryParam" : "q[search]",
1170                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>",
1171                                                     "loadingText" : "Searching...",
1172                                                     "items" : [
1173                                                         {
1174                                                             "listeners" : {
1175                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
1176                                                             },
1177                                                             "xtype" : "Store",
1178                                                             "remoteSort" : true,
1179                                                             "$ xns" : "Roo.data",
1180                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1181                                                             "* prop" : "store",
1182                                                             "items" : [
1183                                                                 {
1184                                                                     "$ url" : "baseURL + '/Roo/vendinfo.php'",
1185                                                                     "xtype" : "HttpProxy",
1186                                                                     "method" : "GET",
1187                                                                     "$ xns" : "Roo.data",
1188                                                                     "* prop" : "proxy"
1189                                                                 },
1190                                                                 {
1191                                                                     "id" : "id",
1192                                                                     "root" : "data",
1193                                                                     "xtype" : "JsonReader",
1194                                                                     "$ xns" : "Roo.data",
1195                                                                     "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"vend_name\",\"type\":\"string\"}]",
1196                                                                     "* prop" : "reader",
1197                                                                     "totalProperty" : "total"
1198                                                                 }
1199                                                             ]
1200                                                         }
1201                                                     ]
1202                                                 }
1203                                             ]
1204                                         }
1205                                     ]
1206                                 },
1207                                 {
1208                                     "xtype" : "ColumnModel",
1209                                     "width" : 100,
1210                                     "header" : "Vendor Ref#",
1211                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1212                                     "$ xns" : "Roo.grid",
1213                                     "* prop" : "colModel[]",
1214                                     "dataIndex" : "itemsrc_vend_item_number",
1215                                     "items" : [
1216                                         {
1217                                             "xtype" : "GridEditor",
1218                                             "$ xns" : "Roo.grid",
1219                                             "* prop" : "editor",
1220                                             "items" : [
1221                                                 {
1222                                                     "xtype" : "TextField",
1223                                                     "$ xns" : "Roo.form",
1224                                                     "* prop" : "field"
1225                                                 }
1226                                             ]
1227                                         }
1228                                     ]
1229                                 },
1230                                 {
1231                                     "xtype" : "ColumnModel",
1232                                     "width" : 200,
1233                                     "header" : "Comments",
1234                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1235                                     "$ xns" : "Roo.grid",
1236                                     "* prop" : "colModel[]",
1237                                     "dataIndex" : "itemsrc_comments",
1238                                     "items" : [
1239                                         {
1240                                             "xtype" : "GridEditor",
1241                                             "$ xns" : "Roo.grid",
1242                                             "* prop" : "editor",
1243                                             "items" : [
1244                                                 {
1245                                                     "xtype" : "TextField",
1246                                                     "$ xns" : "Roo.form",
1247                                                     "* prop" : "field"
1248                                                 }
1249                                             ]
1250                                         }
1251                                     ]
1252                                 },
1253                                 {
1254                                     "xtype" : "ColumnModel",
1255                                     "width" : 50,
1256                                     "header" : "UOM",
1257                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1258                                     "$ xns" : "Roo.grid",
1259                                     "* prop" : "colModel[]",
1260                                     "dataIndex" : "itemsrc_vend_uom"
1261                                 },
1262                                 {
1263                                     "align" : "right",
1264                                     "xtype" : "ColumnModel",
1265                                     "header" : "Min Qty",
1266                                     "width" : 50,
1267                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1268                                     "$ xns" : "Roo.grid",
1269                                     "* prop" : "colModel[]",
1270                                     "dataIndex" : "itemsrc_minordqty",
1271                                     "items" : [
1272                                         {
1273                                             "xtype" : "GridEditor",
1274                                             "$ xns" : "Roo.grid",
1275                                             "* prop" : "editor",
1276                                             "items" : [
1277                                                 {
1278                                                     "minValue" : 0,
1279                                                     "xtype" : "NumberField",
1280                                                     "decimalPrecision" : 0,
1281                                                     "$ xns" : "Roo.form",
1282                                                     "* prop" : "field"
1283                                                 }
1284                                             ]
1285                                         }
1286                                     ]
1287                                 },
1288                                 {
1289                                     "align" : "right",
1290                                     "xtype" : "ColumnModel",
1291                                     "header" : "Lead time",
1292                                     "width" : 75,
1293                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1294                                     "$ xns" : "Roo.grid",
1295                                     "* prop" : "colModel[]",
1296                                     "dataIndex" : "itemsrc_leadtime",
1297                                     "items" : [
1298                                         {
1299                                             "xtype" : "GridEditor",
1300                                             "$ xns" : "Roo.grid",
1301                                             "* prop" : "editor",
1302                                             "items" : [
1303                                                 {
1304                                                     "minValue" : 0,
1305                                                     "xtype" : "NumberField",
1306                                                     "decimalPrecision" : 0,
1307                                                     "$ xns" : "Roo.form",
1308                                                     "* prop" : "field"
1309                                                 }
1310                                             ]
1311                                         }
1312                                     ]
1313                                 },
1314                                 {
1315                                     "xtype" : "ColumnModel",
1316                                     "width" : 50,
1317                                     "header" : "Active",
1318                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1319                                     "$ xns" : "Roo.grid",
1320                                     "* prop" : "colModel[]",
1321                                     "dataIndex" : "itemsrc_active"
1322                                 }
1323                             ]
1324                         }
1325                     ]
1326                 },
1327                 {
1328                     "listeners" : {
1329                         "|activate" : "function() {\n    _this.hpanel = this;\n    if (_this.hgrid) {\n        _this.hgrid.footer.onClick('first');\n    }\n}"
1330                     },
1331                     "region" : "center",
1332                     "fitToframe" : true,
1333                     "background" : true,
1334                     "title" : "History",
1335                     "xtype" : "GridPanel",
1336                     "fitContainer" : true,
1337                     "$ xns" : "Roo",
1338                     "tableName" : "events",
1339                     "items" : [
1340                         {
1341                             "listeners" : {
1342                                 "|render" : "function() \n{\n    _this.hgrid = this; \n    if (_this.hpanel.active) {\n       this.footer.onClick('first');\n    }\n}"
1343                             },
1344                             "autoExpandColumn" : "remarks",
1345                             "xtype" : "Grid",
1346                             "loadMask" : true,
1347                             "$ xns" : "Roo.grid",
1348                             "* prop" : "grid",
1349                             "items" : [
1350                                 {
1351                                     "listeners" : {
1352                                         "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    options.params.on_table = 'item';\n    options.params.on_id = _this.form.findField('item_id').getValue();\n}"
1353                                     },
1354                                     "xtype" : "Store",
1355                                     "remoteSort" : true,
1356                                     "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }",
1357                                     "$ xns" : "Roo.data",
1358                                     "* prop" : "dataSource",
1359                                     "items" : [
1360                                         {
1361                                             "$ url" : "baseURL + '/Roo/events.php'",
1362                                             "method" : "GET",
1363                                             "xtype" : "HttpProxy",
1364                                             "$ xns" : "Roo.data",
1365                                             "* prop" : "proxy"
1366                                         },
1367                                         {
1368                                             "id" : "id",
1369                                             "root" : "data",
1370                                             "xtype" : "JsonReader",
1371                                             "$ fields" : "[\n    {\n        'name': 'event_when',\n        'type': 'date'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    }\n]",
1372                                             "$ xns" : "Roo.data",
1373                                             "* prop" : "reader",
1374                                             "totalProperty" : "total"
1375                                         }
1376                                     ]
1377                                 },
1378                                 {
1379                                     "pageSize" : 25,
1380                                     "xtype" : "PagingToolbar",
1381                                     "emptyMsg" : "No Events found",
1382                                     "$ xns" : "Roo",
1383                                     "displayMsg" : "Displaying events{0} - {1} of {2}",
1384                                     "displayInfo" : true,
1385                                     "* prop" : "footer"
1386                                 },
1387                                 {
1388                                     "xtype" : "ColumnModel",
1389                                     "width" : 120,
1390                                     "header" : "Changed",
1391                                     "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
1392                                     "$ xns" : "Roo.grid",
1393                                     "* prop" : "colModel[]",
1394                                     "dataIndex" : "event_when"
1395                                 },
1396                                 {
1397                                     "xtype" : "ColumnModel",
1398                                     "width" : 200,
1399                                     "header" : "Action",
1400                                     "$ renderer" : "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
1401                                     "$ xns" : "Roo.grid",
1402                                     "* prop" : "colModel[]",
1403                                     "dataIndex" : "action"
1404                                 },
1405                                 {
1406                                     "xtype" : "ColumnModel",
1407                                     "width" : 200,
1408                                     "header" : "IP Address",
1409                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1410                                     "$ xns" : "Roo.grid",
1411                                     "* prop" : "colModel[]",
1412                                     "dataIndex" : "ipaddr"
1413                                 },
1414                                 {
1415                                     "xtype" : "ColumnModel",
1416                                     "width" : 75,
1417                                     "header" : "Who",
1418                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1419                                     "$ xns" : "Roo.grid",
1420                                     "* prop" : "colModel[]",
1421                                     "dataIndex" : "person_id_name"
1422                                 },
1423                                 {
1424                                     "xtype" : "ColumnModel",
1425                                     "width" : 200,
1426                                     "header" : "Notes",
1427                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1428                                     "$ xns" : "Roo.grid",
1429                                     "* prop" : "colModel[]",
1430                                     "dataIndex" : "remarks"
1431                                 }
1432                             ]
1433                         }
1434                     ]
1435                 },
1436                 {
1437                     "listeners" : {
1438                         "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
1439                     },
1440                     "text" : "Cancel",
1441                     "xtype" : "Button",
1442                     "$ xns" : "Roo",
1443                     "* prop" : "buttons[]"
1444                 },
1445                 {
1446                     "listeners" : {
1447                         "render" : "function (_self)\n{\n    _this.saveBtn = this;\n}",
1448                         "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    \n  //  _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
1449                     },
1450                     "text" : "Save",
1451                     "xtype" : "Button",
1452                     "$ xns" : "Roo",
1453                     "* prop" : "buttons[]"
1454                 }
1455             ]
1456         }
1457     ]
1458 }