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                                                             "method" : "GET",
142                                                             "xtype" : "HttpProxy",
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                                             "listWidth" : 400,
161                                             "triggerAction" : "all",
162                                             "fieldLabel" : "Invoice UOM",
163                                             "forceSelection" : true,
164                                             "selectOnFocus" : true,
165                                             "pageSize" : 20,
166                                             "displayField" : "uom_descrip",
167                                             "emptyText" : "Select uom",
168                                             "hiddenName" : "item_inv_uom_id",
169                                             "minChars" : 2,
170                                             "valueField" : "uom_id",
171                                             "xtype" : "ComboBox",
172                                             "allowBlank" : false,
173                                             "typeAhead" : true,
174                                             "editable" : false,
175                                             "width" : 200,
176                                             "$ xns" : "Roo.form",
177                                             "name" : "item_inv_uom_id_uom_descrip",
178                                             "qtip" : "Select classcode",
179                                             "queryParam" : "",
180                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>",
181                                             "loadingText" : "Searching...",
182                                             "items" : [
183                                                 {
184                                                     "listeners" : {
185                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
186                                                     },
187                                                     "xtype" : "Store",
188                                                     "remoteSort" : true,
189                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'uom_name' }",
190                                                     "$ xns" : "Roo.data",
191                                                     "* prop" : "store",
192                                                     "items" : [
193                                                         {
194                                                             "$ url" : "baseURL + '/Roo/uom.php'",
195                                                             "xtype" : "HttpProxy",
196                                                             "method" : "GET",
197                                                             "$ xns" : "Roo.data",
198                                                             "* prop" : "proxy"
199                                                         },
200                                                         {
201                                                             "id" : "id",
202                                                             "root" : "data",
203                                                             "xtype" : "JsonReader",
204                                                             "$ xns" : "Roo.data",
205                                                             "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"uom_name\",\"type\":\"string\"},\n    {\"name\":\"uom_descrip\",\"type\":\"string\"},\n]",
206                                                             "* prop" : "reader",
207                                                             "totalProperty" : "total"
208                                                         }
209                                                     ]
210                                                 }
211                                             ]
212                                         },
213                                         {
214                                             "fieldLabel" : "Weight",
215                                             "xtype" : "NumberField",
216                                             "allowBlank" : false,
217                                             "allowDecimals" : true,
218                                             "decimalPrecision" : 2,
219                                             "width" : 200,
220                                             "$ xns" : "Roo.form",
221                                             "name" : "item_prodweight"
222                                         },
223                                         {
224                                             "fieldLabel" : "Item comments",
225                                             "xtype" : "TextArea",
226                                             "width" : 200,
227                                             "$ xns" : "Roo.form",
228                                             "name" : "item_comments",
229                                             "height" : 100
230                                         },
231                                         {
232                                             "fieldLabel" : "Item sold",
233                                             "inputValue" : true,
234                                             "xtype" : "Checkbox",
235                                             "valueOff" : 0,
236                                             "width" : 75,
237                                             "$ xns" : "Roo.form",
238                                             "name" : "item_sold"
239                                         },
240                                         {
241                                             "fieldLabel" : "Item active",
242                                             "inputValue" : true,
243                                             "xtype" : "Checkbox",
244                                             "valueOff" : 0,
245                                             "width" : 75,
246                                             "$ xns" : "Roo.form",
247                                             "name" : "item_active"
248                                         },
249                                         {
250                                             "listeners" : {
251                                                 "add" : "function (combo)\n{\n    Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});\n}",
252                                                 "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}"
253                                             },
254                                             "alwaysQuery" : true,
255                                             "listWidth" : 400,
256                                             "triggerAction" : "all",
257                                             "fieldLabel" : "Product Category",
258                                             "forceSelection" : true,
259                                             "selectOnFocus" : true,
260                                             "pageSize" : 20,
261                                             "displayField" : "prodcat_code",
262                                             "emptyText" : "Select Category",
263                                             "hiddenName" : "item_prodcat_id",
264                                             "minChars" : 2,
265                                             "valueField" : "prodcat_id",
266                                             "xtype" : "ComboBox",
267                                             "allowBlank" : false,
268                                             "typeAhead" : true,
269                                             "editable" : false,
270                                             "width" : 200,
271                                             "$ xns" : "Roo.form",
272                                             "name" : "item_prodcat_id_prodcat_code",
273                                             "qtip" : "Select prodcat",
274                                             "queryParam" : "",
275                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>",
276                                             "loadingText" : "Searching...",
277                                             "items" : [
278                                                 {
279                                                     "listeners" : {
280                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
281                                                     },
282                                                     "xtype" : "Store",
283                                                     "remoteSort" : true,
284                                                     "$ xns" : "Roo.data",
285                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
286                                                     "* prop" : "store",
287                                                     "items" : [
288                                                         {
289                                                             "$ url" : "baseURL + '/Roo/prodcat.php'",
290                                                             "xtype" : "HttpProxy",
291                                                             "method" : "GET",
292                                                             "$ xns" : "Roo.data",
293                                                             "* prop" : "proxy"
294                                                         },
295                                                         {
296                                                             "id" : "id",
297                                                             "root" : "data",
298                                                             "xtype" : "JsonReader",
299                                                             "$ xns" : "Roo.data",
300                                                             "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"prodcat_code\",\"type\":\"string\"}]",
301                                                             "* prop" : "reader",
302                                                             "totalProperty" : "total"
303                                                         }
304                                                     ]
305                                                 }
306                                             ]
307                                         },
308                                         {
309                                             "fieldLabel" : "Sales Account",
310                                             "xtype" : "DisplayField",
311                                             "$ xns" : "Roo.form",
312                                             "name" : "item_salesaccnt"
313                                         },
314                                         {
315                                             "fieldLabel" : "Item listprice",
316                                             "xtype" : "NumberField",
317                                             "width" : 200,
318                                             "$ xns" : "Roo.form",
319                                             "name" : "item_listprice"
320                                         },
321                                         {
322                                             "listeners" : {
323                                                 "render" : "function (_self)\n{\n    _this.standardCostFieldSet = _self;\n}"
324                                             },
325                                             "style" : "width:320px",
326                                             "xtype" : "FieldSet",
327                                             "legend" : "Standard Cost",
328                                             "$ xns" : "Roo.form",
329                                             "items" : [
330                                                 {
331                                                     "listWidth" : 400,
332                                                     "triggerAction" : "all",
333                                                     "fieldLabel" : "Currency",
334                                                     "forceSelection" : true,
335                                                     "selectOnFocus" : true,
336                                                     "pageSize" : 20,
337                                                     "displayField" : "curr_name",
338                                                     "emptyText" : "Select Currency",
339                                                     "hiddenName" : "item_itemcost_id_itemcost_curr_id",
340                                                     "minChars" : 2,
341                                                     "valueField" : "curr_id",
342                                                     "xtype" : "ComboBox",
343                                                     "allowBlank" : false,
344                                                     "typeAhead" : true,
345                                                     "editable" : false,
346                                                     "width" : 200,
347                                                     "$ xns" : "Roo.form",
348                                                     "name" : "curr_name",
349                                                     "qtip" : "Select Currency",
350                                                     "queryParam" : "query[curr_name]",
351                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
352                                                     "loadingText" : "Searching...",
353                                                     "items" : [
354                                                         {
355                                                             "listeners" : {
356                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   \n}\n"
357                                                             },
358                                                             "xtype" : "Store",
359                                                             "remoteSort" : true,
360                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'curr_symbol' }",
361                                                             "$ xns" : "Roo.data",
362                                                             "* prop" : "store",
363                                                             "items" : [
364                                                                 {
365                                                                     "$ url" : "baseURL + '/Roo/curr_symbol.php'",
366                                                                     "xtype" : "HttpProxy",
367                                                                     "method" : "GET",
368                                                                     "$ xns" : "Roo.data",
369                                                                     "* prop" : "proxy"
370                                                                 },
371                                                                 {
372                                                                     "id" : "curr_id",
373                                                                     "root" : "data",
374                                                                     "xtype" : "JsonReader",
375                                                                     "$ xns" : "Roo.data",
376                                                                     "$ fields" : "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]",
377                                                                     "* prop" : "reader",
378                                                                     "totalProperty" : "total"
379                                                                 }
380                                                             ]
381                                                         }
382                                                     ]
383                                                 },
384                                                 {
385                                                     "fieldLabel" : "Value",
386                                                     "xtype" : "NumberField",
387                                                     "allowBlank" : false,
388                                                     "width" : 200,
389                                                     "$ xns" : "Roo.form",
390                                                     "name" : "item_itemcost_id_itemcost_actcost"
391                                                 }
392                                             ]
393                                         }
394                                     ]
395                                 },
396                                 {
397                                     "xtype" : "Column",
398                                     "$ xns" : "Roo.form",
399                                     "items" : [
400                                         {
401                                             "listeners" : {
402                                                 "render" : "function (_self)\n{\n    _this.itemsiteFieldSet = _self;\n}"
403                                             },
404                                             "xtype" : "FieldSet",
405                                             "legend" : "Itemsite Settings",
406                                             "$ xns" : "Roo.form",
407                                             "String/Object/Function style" : "width:335px;",
408                                             "Number labelWidth" : 120,
409                                             "items" : [
410                                                 {
411                                                     "fieldLabel" : "Reorder Level",
412                                                     "xtype" : "NumberField",
413                                                     "allowBlank" : false,
414                                                     "width" : 200,
415                                                     "$ xns" : "Roo.form",
416                                                     "name" : "item_itemsite_id_itemsite_reorderlevel"
417                                                 },
418                                                 {
419                                                     "fieldLabel" : "Stock Safety Level",
420                                                     "xtype" : "NumberField",
421                                                     "allowBlank" : false,
422                                                     "width" : 200,
423                                                     "$ xns" : "Roo.form",
424                                                     "name" : "item_itemsite_id_itemsite_safetystock"
425                                                 },
426                                                 {
427                                                     "fieldLabel" : "Lead time (Days)",
428                                                     "xtype" : "NumberField",
429                                                     "allowBlank" : false,
430                                                     "width" : 200,
431                                                     "$ xns" : "Roo.form",
432                                                     "name" : "item_itemsite_id_itemsite_leadtime"
433                                                 },
434                                                 {
435                                                     "listWidth" : 200,
436                                                     "triggerAction" : "all",
437                                                     "fieldLabel" : "Control Method",
438                                                     "displayField" : "fname",
439                                                     "hiddenName" : "item_itemsite_id_itemsite_controlmethod",
440                                                     "valueField" : "ftype",
441                                                     "xtype" : "ComboBox",
442                                                     "allowBlank" : false,
443                                                     "editable" : false,
444                                                     "width" : 200,
445                                                     "$ xns" : "Roo.form",
446                                                     "mode" : "local",
447                                                     "name" : "item_itemsite_id_itemsite_controlmethod_name",
448                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
449                                                     "items" : [
450                                                         {
451                                                             "xtype" : "SimpleStore",
452                                                             "$ data" : "[ \n    [ 'N', \"None\"],\n    [ 'R' , \"Regular\"]\n]\n",
453                                                             "$ fields" : "[  'ftype', 'fname']",
454                                                             "$ xns" : "Roo.data",
455                                                             "* prop" : "store"
456                                                         }
457                                                     ]
458                                                 },
459                                                 {
460                                                     "listWidth" : 400,
461                                                     "triggerAction" : "all",
462                                                     "fieldLabel" : "Planner Code",
463                                                     "forceSelection" : true,
464                                                     "selectOnFocus" : true,
465                                                     "pageSize" : 20,
466                                                     "displayField" : "plancode_name",
467                                                     "emptyText" : "Select plancode",
468                                                     "hiddenName" : "item_itemsite_id_itemsite_plancode_id",
469                                                     "minChars" : 2,
470                                                     "valueField" : "plancode_id",
471                                                     "xtype" : "ComboBox",
472                                                     "allowBlank" : false,
473                                                     "typeAhead" : true,
474                                                     "editable" : false,
475                                                     "width" : 200,
476                                                     "$ xns" : "Roo.form",
477                                                     "name" : "plancode_name",
478                                                     "qtip" : "Select plancode",
479                                                     "queryParam" : "",
480                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</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/plancode.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\":\"plancode_code\",\"type\":\"string\"}]",
506                                                                     "* prop" : "reader",
507                                                                     "totalProperty" : "total"
508                                                                 }
509                                                             ]
510                                                         }
511                                                     ]
512                                                 },
513                                                 {
514                                                     "listWidth" : 400,
515                                                     "triggerAction" : "all",
516                                                     "fieldLabel" : "Costcat",
517                                                     "forceSelection" : true,
518                                                     "selectOnFocus" : true,
519                                                     "pageSize" : 20,
520                                                     "displayField" : "costcat_code",
521                                                     "emptyText" : "Select costcat",
522                                                     "hiddenName" : "item_itemsite_id_itemsite_costcat_id",
523                                                     "minChars" : 2,
524                                                     "valueField" : "costcat_id",
525                                                     "xtype" : "ComboBox",
526                                                     "allowBlank" : false,
527                                                     "typeAhead" : true,
528                                                     "editable" : false,
529                                                     "width" : 200,
530                                                     "$ xns" : "Roo.form",
531                                                     "name" : "costcat_code",
532                                                     "qtip" : "Select costcat",
533                                                     "queryParam" : "",
534                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>",
535                                                     "loadingText" : "Searching...",
536                                                     "items" : [
537                                                         {
538                                                             "listeners" : {
539                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
540                                                             },
541                                                             "xtype" : "Store",
542                                                             "remoteSort" : true,
543                                                             "$ xns" : "Roo.data",
544                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
545                                                             "* prop" : "store",
546                                                             "items" : [
547                                                                 {
548                                                                     "$ url" : "baseURL + '/Roo/costcat.php'",
549                                                                     "xtype" : "HttpProxy",
550                                                                     "method" : "GET",
551                                                                     "$ xns" : "Roo.data",
552                                                                     "* prop" : "proxy"
553                                                                 },
554                                                                 {
555                                                                     "id" : "id",
556                                                                     "root" : "data",
557                                                                     "xtype" : "JsonReader",
558                                                                     "$ xns" : "Roo.data",
559                                                                     "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"costcat_code\",\"type\":\"string\"}]",
560                                                                     "* prop" : "reader",
561                                                                     "totalProperty" : "total"
562                                                                 }
563                                                             ]
564                                                         }
565                                                     ]
566                                                 },
567                                                 {
568                                                     "fieldLabel" : "Active",
569                                                     "inputValue" : true,
570                                                     "xtype" : "Checkbox",
571                                                     "valueOff" : 0,
572                                                     "width" : 75,
573                                                     "$ xns" : "Roo.form",
574                                                     "name" : "item_itemsite_id_itemsite_active"
575                                                 },
576                                                 {
577                                                     "fieldLabel" : "Sold",
578                                                     "inputValue" : true,
579                                                     "xtype" : "Checkbox",
580                                                     "valueOff" : 0,
581                                                     "width" : 75,
582                                                     "$ xns" : "Roo.form",
583                                                     "name" : "item_itemsite_id_itemsite_sold"
584                                                 },
585                                                 {
586                                                     "fieldLabel" : "Stocked",
587                                                     "inputValue" : true,
588                                                     "xtype" : "Checkbox",
589                                                     "valueOff" : 0,
590                                                     "width" : 75,
591                                                     "$ xns" : "Roo.form",
592                                                     "name" : "item_itemsite_id_itemsite_stocked"
593                                                 },
594                                                 {
595                                                     "fieldLabel" : "Perishable",
596                                                     "inputValue" : true,
597                                                     "xtype" : "Checkbox",
598                                                     "valueOff" : 0,
599                                                     "width" : 75,
600                                                     "$ xns" : "Roo.form",
601                                                     "name" : "item_itemsite_id_itemsite_perishable"
602                                                 },
603                                                 {
604                                                     "fieldLabel" : "Multi Location",
605                                                     "inputValue" : true,
606                                                     "xtype" : "Checkbox",
607                                                     "valueOff" : 0,
608                                                     "width" : 100,
609                                                     "$ xns" : "Roo.form",
610                                                     "name" : "item_itemsite_id_itemsite_loccntrl"
611                                                 },
612                                                 {
613                                                     "listWidth" : 400,
614                                                     "triggerAction" : "all",
615                                                     "fieldLabel" : "Default Location",
616                                                     "forceSelection" : true,
617                                                     "selectOnFocus" : true,
618                                                     "pageSize" : 200,
619                                                     "displayField" : "location_name",
620                                                     "emptyText" : "Default Location",
621                                                     "hiddenName" : "item_itemsite_id_itemsite_location_id",
622                                                     "minChars" : 2,
623                                                     "valueField" : "location_id",
624                                                     "xtype" : "ComboBox",
625                                                     "allowBlank" : false,
626                                                     "typeAhead" : false,
627                                                     "editable" : true,
628                                                     "width" : 200,
629                                                     "$ xns" : "Roo.form",
630                                                     "name" : "location_name",
631                                                     "qtip" : "Select terms",
632                                                     "queryParam" : "query[location_name]",
633                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
634                                                     "loadingText" : "Searching...",
635                                                     "items" : [
636                                                         {
637                                                             "listeners" : {
638                                                                 "|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"
639                                                             },
640                                                             "xtype" : "Store",
641                                                             "remoteSort" : true,
642                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'location_name' }",
643                                                             "$ xns" : "Roo.data",
644                                                             "* prop" : "store",
645                                                             "items" : [
646                                                                 {
647                                                                     "$ url" : "baseURL + '/Roo/location.php'",
648                                                                     "method" : "GET",
649                                                                     "xtype" : "HttpProxy",
650                                                                     "$ xns" : "Roo.data",
651                                                                     "* prop" : "proxy"
652                                                                 },
653                                                                 {
654                                                                     "id" : "location_id",
655                                                                     "root" : "data",
656                                                                     "xtype" : "JsonReader",
657                                                                     "$ fields" : "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
658                                                                     "$ xns" : "Roo.data",
659                                                                     "* prop" : "reader",
660                                                                     "totalProperty" : "total"
661                                                                 }
662                                                             ]
663                                                         }
664                                                     ]
665                                                 }
666                                             ]
667                                         }
668                                     ]
669                                 },
670                                 {
671                                     "xtype" : "Hidden",
672                                     "$ xns" : "Roo.form",
673                                     "width" : 75,
674                                     "name" : "item_id"
675                                 },
676                                 {
677                                     "value" : 1,
678                                     "xtype" : "Hidden",
679                                     "width" : 75,
680                                     "$ xns" : "Roo.form",
681                                     "name" : "_update_related"
682                                 }
683                             ]
684                         }
685                     ]
686                 },
687                 {
688                     "listeners" : {
689                         "|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}"
690                     },
691                     "background" : true,
692                     "region" : "center",
693                     "fitToframe" : true,
694                     "title" : "Item Parts",
695                     "xtype" : "GridPanel",
696                     "fitContainer" : true,
697                     "$ xns" : "Roo",
698                     "tableName" : "bomitem",
699                     "items" : [
700                         {
701                             "listeners" : {
702                                 "beforeedit" : "function (e)\n{\n    if(e.field != 'bomitem_qtyper'){\n        return false;\n    }\n    \n}",
703                                 "|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}",
704                                 "afteredit" : "function (e)\n{\n    if(e.originalValue == e.value){\n        return false;\n    }\n    \n    \n    new Pman.Request({\n        method : 'POST',\n        url : baseURL + '/Roo/bomitem.php',\n        mask : 'Saving',\n        params : {\n            bomitem_id : e.record.data.bomitem_id,\n            bomitem_qtyper : e.value\n        },\n        success : function() {\n            e.record.set('bomitem_qtyper', e.value);\n        }\n    \n    });\n        \n         \n        \n        \n}"
705                             },
706                             "autoExpandColumn" : "bomitem_item_id_item_descrip1",
707                             "xtype" : "EditorGrid",
708                             "loadMask" : true,
709                             "clicksToEdit" : 1,
710                             "$ xns" : "Roo.grid",
711                             "* prop" : "grid",
712                             "items" : [
713                                 {
714                                     "xtype" : "Toolbar",
715                                     "$ xns" : "Roo",
716                                     "* prop" : "toolbar",
717                                     "items" : [
718                                         {
719                                             "listeners" : {
720                                                 "render" : "function (_self)\n{\n    _this.partsBox = _self;\n}",
721                                                 "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}"
722                                             },
723                                             "alwaysQuery" : true,
724                                             "triggerAction" : "all",
725                                             "fieldLabel" : "Item",
726                                             "forceSelection" : true,
727                                             "selectOnFocus" : true,
728                                             "pageSize" : 20,
729                                             "displayField" : "item_number",
730                                             "emptyText" : "Select item",
731                                             "minChars" : 2,
732                                             "valueField" : "id",
733                                             "xtype" : "ComboBox",
734                                             "allowBlank" : true,
735                                             "typeAhead" : true,
736                                             "editable" : true,
737                                             "width" : 200,
738                                             "$ xns" : "Roo.bootstrap",
739                                             "qtip" : "Select item",
740                                             "queryParam" : "query[number_or_name]",
741                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>",
742                                             "loadingText" : "Searching...",
743                                             "items" : [
744                                                 {
745                                                     "listeners" : {
746                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params.item_active = 1;\n    o.params['!item_type'] = 'K';\n}\n"
747                                                     },
748                                                     "xtype" : "Store",
749                                                     "remoteSort" : true,
750                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'item_number' }",
751                                                     "$ xns" : "Roo.data",
752                                                     "* prop" : "store",
753                                                     "items" : [
754                                                         {
755                                                             "$ url" : "baseURL + '/Roo/item.php'",
756                                                             "method" : "GET",
757                                                             "xtype" : "HttpProxy",
758                                                             "$ xns" : "Roo.data",
759                                                             "* prop" : "proxy"
760                                                         },
761                                                         {
762                                                             "id" : "id",
763                                                             "root" : "data",
764                                                             "xtype" : "JsonReader",
765                                                             "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"item_number\",\"type\":\"string\"}\n]",
766                                                             "$ xns" : "Roo.data",
767                                                             "* prop" : "reader",
768                                                             "totalProperty" : "total"
769                                                         }
770                                                     ]
771                                                 }
772                                             ]
773                                         },
774                                         {
775                                             "xtype" : "Fill",
776                                             "$ xns" : "Roo.Toolbar"
777                                         },
778                                         {
779                                             "listeners" : {
780                                                 "|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}"
781                                             },
782                                             "text" : "Remove",
783                                             "xtype" : "Button",
784                                             "cls" : "x-btn-text-icon",
785                                             "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
786                                             "$ xns" : "Roo"
787                                         }
788                                     ]
789                                 },
790                                 {
791                                     "listeners" : {
792                                         "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}"
793                                     },
794                                     "xtype" : "Store",
795                                     "remoteSort" : true,
796                                     "$ sortInfo" : "{ field : 'bomitem_item_id_item_name', direction: 'ASC' }",
797                                     "$ xns" : "Roo.data",
798                                     "* prop" : "dataSource",
799                                     "items" : [
800                                         {
801                                             "$ url" : "baseURL + '/Roo/bomitem.php'",
802                                             "xtype" : "HttpProxy",
803                                             "method" : "GET",
804                                             "$ xns" : "Roo.data",
805                                             "* prop" : "proxy"
806                                         },
807                                         {
808                                             "id" : "bom_id",
809                                             "root" : "data",
810                                             "xtype" : "JsonReader",
811                                             "$ fields" : "[\n    {\n        'name': 'bomitem_id',\n        'type': 'int'\n    }\n]",
812                                             "$ xns" : "Roo.data",
813                                             "* prop" : "reader",
814                                             "totalProperty" : "total"
815                                         }
816                                     ]
817                                 },
818                                 {
819                                     "pageSize" : 50,
820                                     "xtype" : "PagingToolbar",
821                                     "emptyMsg" : "Nothing found",
822                                     "$ xns" : "Roo",
823                                     "displayMsg" : "Displaying parts {0} - {1} of {2}",
824                                     "displayInfo" : true,
825                                     "* prop" : "footer"
826                                 },
827                                 {
828                                     "xtype" : "ColumnModel",
829                                     "header" : "Name",
830                                     "width" : 150,
831                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
832                                     "$ xns" : "Roo.grid",
833                                     "* prop" : "colModel[]",
834                                     "dataIndex" : "bomitem_item_id_item_number"
835                                 },
836                                 {
837                                     "xtype" : "ColumnModel",
838                                     "header" : "Description",
839                                     "width" : 150,
840                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
841                                     "$ xns" : "Roo.grid",
842                                     "* prop" : "colModel[]",
843                                     "dataIndex" : "bomitem_item_id_item_descrip1"
844                                 },
845                                 {
846                                     "xtype" : "ColumnModel",
847                                     "String align" : "right",
848                                     "header" : "Qty",
849                                     "width" : 100,
850                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
851                                     "$ xns" : "Roo.grid",
852                                     "* prop" : "colModel[]",
853                                     "dataIndex" : "bomitem_qtyper",
854                                     "items" : [
855                                         {
856                                             "xtype" : "GridEditor",
857                                             "$ xns" : "Roo.grid",
858                                             "* prop" : "editor",
859                                             "items" : [
860                                                 {
861                                                     "Boolean allowBlank" : false,
862                                                     "String cls" : "align-right",
863                                                     "xtype" : "NumberField",
864                                                     "Number decimalPrecision" : 0,
865                                                     "$ xns" : "Roo.form",
866                                                     "* prop" : "field",
867                                                     "Number minValue" : 0
868                                                 }
869                                             ]
870                                         }
871                                     ]
872                                 }
873                             ]
874                         }
875                     ]
876                 },
877                 {
878                     "listeners" : {
879                         "|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}"
880                     },
881                     "region" : "center",
882                     "fitToframe" : true,
883                     "background" : true,
884                     "title" : "Reference Files",
885                     "xtype" : "GridPanel",
886                     "fitContainer" : true,
887                     "$ xns" : "Roo",
888                     "tableName" : "Images",
889                     "items" : [
890                         {
891                             "listeners" : {
892                                 "|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}",
893                                 "|render" : "function() { \n    _this.grid = this; \n\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
894                             },
895                             "autoExpandColumn" : "id",
896                             "xtype" : "Grid",
897                             "loadMask" : true,
898                             "$ xns" : "Roo.grid",
899                             "* prop" : "grid",
900                             "items" : [
901                                 {
902                                     "listeners" : {
903                                         "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}"
904                                     },
905                                     "xtype" : "Store",
906                                     "remoteSort" : true,
907                                     "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }",
908                                     "$ xns" : "Roo.data",
909                                     "* prop" : "dataSource",
910                                     "items" : [
911                                         {
912                                             "id" : "id",
913                                             "root" : "data",
914                                             "xtype" : "JsonReader",
915                                             "$ 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]",
916                                             "$ xns" : "Roo.data",
917                                             "* prop" : "reader",
918                                             "totalProperty" : "total"
919                                         },
920                                         {
921                                             "$ url" : "baseURL + '/Roo/Images.php'",
922                                             "xtype" : "HttpProxy",
923                                             "method" : "GET",
924                                             "$ xns" : "Roo.data",
925                                             "* prop" : "proxy"
926                                         }
927                                     ]
928                                 },
929                                 {
930                                     "pageSize" : 25,
931                                     "xtype" : "PagingToolbar",
932                                     "emptyMsg" : "No Images found",
933                                     "$ xns" : "Roo",
934                                     "displayInfo" : true,
935                                     "displayMsg" : "Displaying Images  {0} - {1} of {2}",
936                                     "* prop" : "footer"
937                                 },
938                                 {
939                                     "xtype" : "Toolbar",
940                                     "$ xns" : "Roo",
941                                     "* prop" : "toolbar",
942                                     "items" : [
943                                         {
944                                             "listeners" : {
945                                                 "|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}       "
946                                             },
947                                             "text" : "Add",
948                                             "xtype" : "Button",
949                                             "cls" : "x-btn-text-icon",
950                                             "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
951                                             "$ xns" : "Roo.Toolbar"
952                                         },
953                                         {
954                                             "listeners" : {
955                                                 "|click" : "function()\n{\n    Pman.genericDelete(_this, 'Images'); \n}\n        "
956                                             },
957                                             "text" : "Delete",
958                                             "xtype" : "Button",
959                                             "cls" : "x-btn-text-icon",
960                                             "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
961                                             "$ xns" : "Roo.Toolbar"
962                                         }
963                                     ]
964                                 },
965                                 {
966                                     "xtype" : "ColumnModel",
967                                     "sortable" : true,
968                                     "header" : "Created",
969                                     "width" : 200,
970                                     "$ 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     ",
971                                     "$ xns" : "Roo.grid",
972                                     "* prop" : "colModel[]",
973                                     "dataIndex" : "created"
974                                 },
975                                 {
976                                     "xtype" : "ColumnModel",
977                                     "width" : 100,
978                                     "header" : "Image",
979                                     "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" height=\"100\">', baseURL, v, r.data.filename); }",
980                                     "$ xns" : "Roo.grid",
981                                     "* prop" : "colModel[]",
982                                     "dataIndex" : "id"
983                                 }
984                             ]
985                         }
986                     ]
987                 },
988                 {
989                     "listeners" : {
990                         "|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}"
991                     },
992                     "region" : "center",
993                     "fitToframe" : true,
994                     "background" : true,
995                     "title" : "Price List",
996                     "xtype" : "GridPanel",
997                     "fitContainer" : true,
998                     "$ xns" : "Roo",
999                     "tableName" : "ipshead",
1000                     "items" : [
1001                         {
1002                             "listeners" : {
1003                                 "beforeedit" : "function (e)\n{\n    if(e.field != 'ipshead_ipsitem_price'){\n        return false;\n    }\n    \n}",
1004                                 "|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}",
1005                                 "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}"
1006                             },
1007                             "autoExpandColumn" : "ipshead_descrip",
1008                             "xtype" : "EditorGrid",
1009                             "loadMask" : true,
1010                             "clicksToEdit" : 1,
1011                             "$ xns" : "Roo.grid",
1012                             "* prop" : "grid",
1013                             "items" : [
1014                                 {
1015                                     "listeners" : {
1016                                         "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}"
1017                                     },
1018                                     "xtype" : "Store",
1019                                     "remoteSort" : true,
1020                                     "$ sortInfo" : "{ field : 'ipshead_id', direction: 'ASC' }",
1021                                     "$ xns" : "Roo.data",
1022                                     "* prop" : "dataSource",
1023                                     "items" : [
1024                                         {
1025                                             "$ url" : "baseURL + '/Roo/ipshead.php'",
1026                                             "method" : "GET",
1027                                             "xtype" : "HttpProxy",
1028                                             "$ xns" : "Roo.data",
1029                                             "* prop" : "proxy"
1030                                         },
1031                                         {
1032                                             "id" : "ipshead_id",
1033                                             "root" : "data",
1034                                             "xtype" : "JsonReader",
1035                                             "$ fields" : "[\n    {\n        'name': 'ipshead_id',\n        'type': 'int'\n    },\n    {\n        'name': 'ipshead_name',\n        'type': 'string'\n    }\n]",
1036                                             "$ xns" : "Roo.data",
1037                                             "* prop" : "reader",
1038                                             "totalProperty" : "total"
1039                                         }
1040                                     ]
1041                                 },
1042                                 {
1043                                     "pageSize" : 50,
1044                                     "xtype" : "PagingToolbar",
1045                                     "emptyMsg" : "Nothing found",
1046                                     "$ xns" : "Roo",
1047                                     "displayMsg" : "Displaying records {0} - {1} of {2}",
1048                                     "displayInfo" : true,
1049                                     "* prop" : "footer"
1050                                 },
1051                                 {
1052                                     "xtype" : "ColumnModel",
1053                                     "width" : 150,
1054                                     "header" : "Name",
1055                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1056                                     "$ xns" : "Roo.grid",
1057                                     "* prop" : "colModel[]",
1058                                     "dataIndex" : "ipshead_name"
1059                                 },
1060                                 {
1061                                     "xtype" : "ColumnModel",
1062                                     "width" : 150,
1063                                     "header" : "Description",
1064                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1065                                     "$ xns" : "Roo.grid",
1066                                     "* prop" : "colModel[]",
1067                                     "dataIndex" : "ipshead_descrip"
1068                                 },
1069                                 {
1070                                     "xtype" : "ColumnModel",
1071                                     "width" : 100,
1072                                     "header" : "Currency",
1073                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1074                                     "$ xns" : "Roo.grid",
1075                                     "* prop" : "colModel[]",
1076                                     "dataIndex" : "ipshead_curr_id_curr_name"
1077                                 },
1078                                 {
1079                                     "align" : "right",
1080                                     "xtype" : "ColumnModel",
1081                                     "header" : "Price",
1082                                     "width" : 120,
1083                                     "$ renderer" : "function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); }",
1084                                     "$ xns" : "Roo.grid",
1085                                     "* prop" : "colModel[]",
1086                                     "dataIndex" : "ipshead_ipsitem_price",
1087                                     "items" : [
1088                                         {
1089                                             "xtype" : "GridEditor",
1090                                             "$ xns" : "Roo.grid",
1091                                             "* prop" : "editor",
1092                                             "items" : [
1093                                                 {
1094                                                     "xtype" : "NumberField",
1095                                                     "cls" : "align-right",
1096                                                     "decimalPrecision" : 2,
1097                                                     "$ xns" : "Roo.form",
1098                                                     "* prop" : "field"
1099                                                 }
1100                                             ]
1101                                         }
1102                                     ]
1103                                 }
1104                             ]
1105                         }
1106                     ]
1107                 },
1108                 {
1109                     "listeners" : {
1110                         "|activate" : "function() {\n    _this.itemsrcpanel = this;\n    if (_this.itemsrcgrid) {\n        _this.itemsrcgrid.footer.onClick('first');\n    }\n}"
1111                     },
1112                     "region" : "center",
1113                     "fitToframe" : true,
1114                     "background" : true,
1115                     "title" : "Suppliers",
1116                     "xtype" : "GridPanel",
1117                     "fitContainer" : true,
1118                     "$ xns" : "Roo",
1119                     "tableName" : "itemsrc",
1120                     "items" : [
1121                         {
1122                             "listeners" : {
1123                                 "|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",
1124                                 "|render" : "function() \n{\n    _this.itemsrcgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    \n}",
1125                                 "afteredit" : "function (e)\n{\n    e.record.commit();\n}"
1126                             },
1127                             "autoExpandColumn" : "itemsrc_comments",
1128                             "xtype" : "EditorGrid",
1129                             "loadMask" : true,
1130                             "clicksToEdit" : 1,
1131                             "$ xns" : "Roo.grid",
1132                             "* prop" : "grid",
1133                             "items" : [
1134                                 {
1135                                     "listeners" : {
1136                                         "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}",
1137                                         "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}"
1138                                     },
1139                                     "xtype" : "Store",
1140                                     "remoteSort" : true,
1141                                     "$ sortInfo" : "{ field : 'itemsrc_vend_id_vend_name', direction: 'ASC' }",
1142                                     "$ xns" : "Roo.data",
1143                                     "* prop" : "dataSource",
1144                                     "items" : [
1145                                         {
1146                                             "$ url" : "baseURL + '/Roo/itemsrc.php'",
1147                                             "xtype" : "HttpProxy",
1148                                             "method" : "GET",
1149                                             "$ xns" : "Roo.data",
1150                                             "* prop" : "proxy"
1151                                         },
1152                                         {
1153                                             "id" : "id",
1154                                             "root" : "data",
1155                                             "xtype" : "JsonReader",
1156                                             "$ xns" : "Roo.data",
1157                                             "$ 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]",
1158                                             "* prop" : "reader",
1159                                             "totalProperty" : "total"
1160                                         }
1161                                     ]
1162                                 },
1163                                 {
1164                                     "pageSize" : 25,
1165                                     "xtype" : "PagingToolbar",
1166                                     "emptyMsg" : "No itemsrc found",
1167                                     "$ xns" : "Roo",
1168                                     "displayInfo" : true,
1169                                     "displayMsg" : "Displaying itemsrc{0} - {1} of {2}",
1170                                     "* prop" : "footer"
1171                                 },
1172                                 {
1173                                     "xtype" : "Toolbar",
1174                                     "$ xns" : "Roo",
1175                                     "* prop" : "toolbar",
1176                                     "items" : [
1177                                         {
1178                                             "listeners" : {
1179                                                 "|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"
1180                                             },
1181                                             "text" : "Add",
1182                                             "xtype" : "Button",
1183                                             "cls" : "x-btn-text-icon",
1184                                             "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1185                                             "$ xns" : "Roo.Toolbar"
1186                                         }
1187                                     ]
1188                                 },
1189                                 {
1190                                     "xtype" : "ColumnModel",
1191                                     "width" : 120,
1192                                     "header" : "Vendor",
1193                                     "$ renderer" : "function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); }",
1194                                     "$ xns" : "Roo.grid",
1195                                     "* prop" : "colModel[]",
1196                                     "dataIndex" : "itemsrc_vend_id",
1197                                     "items" : [
1198                                         {
1199                                             "xtype" : "GridEditor",
1200                                             "$ xns" : "Roo.grid",
1201                                             "* prop" : "editor",
1202                                             "items" : [
1203                                                 {
1204                                                     "listWidth" : 400,
1205                                                     "triggerAction" : "all",
1206                                                     "forceSelection" : true,
1207                                                     "selectOnFocus" : true,
1208                                                     "pageSize" : 20,
1209                                                     "displayField" : "vend_name",
1210                                                     "emptyText" : "Select Vendor",
1211                                                     "hiddenName" : "itemsrc_vend_id",
1212                                                     "minChars" : 2,
1213                                                     "valueField" : "vend_id",
1214                                                     "xtype" : "ComboBox",
1215                                                     "allowBlank" : false,
1216                                                     "typeAhead" : true,
1217                                                     "editable" : true,
1218                                                     "width" : 300,
1219                                                     "$ xns" : "Roo.form",
1220                                                     "* prop" : "field",
1221                                                     "name" : "itemsrc_vend_id_vend_name",
1222                                                     "qtip" : "Select vendinfo",
1223                                                     "queryParam" : "q[search]",
1224                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>",
1225                                                     "loadingText" : "Searching...",
1226                                                     "items" : [
1227                                                         {
1228                                                             "listeners" : {
1229                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
1230                                                             },
1231                                                             "xtype" : "Store",
1232                                                             "remoteSort" : true,
1233                                                             "$ xns" : "Roo.data",
1234                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1235                                                             "* prop" : "store",
1236                                                             "items" : [
1237                                                                 {
1238                                                                     "$ url" : "baseURL + '/Roo/vendinfo.php'",
1239                                                                     "xtype" : "HttpProxy",
1240                                                                     "method" : "GET",
1241                                                                     "$ xns" : "Roo.data",
1242                                                                     "* prop" : "proxy"
1243                                                                 },
1244                                                                 {
1245                                                                     "id" : "id",
1246                                                                     "root" : "data",
1247                                                                     "xtype" : "JsonReader",
1248                                                                     "$ xns" : "Roo.data",
1249                                                                     "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"vend_name\",\"type\":\"string\"}]",
1250                                                                     "* prop" : "reader",
1251                                                                     "totalProperty" : "total"
1252                                                                 }
1253                                                             ]
1254                                                         }
1255                                                     ]
1256                                                 }
1257                                             ]
1258                                         }
1259                                     ]
1260                                 },
1261                                 {
1262                                     "xtype" : "ColumnModel",
1263                                     "width" : 100,
1264                                     "header" : "Vendor Ref#",
1265                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1266                                     "$ xns" : "Roo.grid",
1267                                     "* prop" : "colModel[]",
1268                                     "dataIndex" : "itemsrc_vend_item_number",
1269                                     "items" : [
1270                                         {
1271                                             "xtype" : "GridEditor",
1272                                             "$ xns" : "Roo.grid",
1273                                             "* prop" : "editor",
1274                                             "items" : [
1275                                                 {
1276                                                     "xtype" : "TextField",
1277                                                     "$ xns" : "Roo.form",
1278                                                     "* prop" : "field"
1279                                                 }
1280                                             ]
1281                                         }
1282                                     ]
1283                                 },
1284                                 {
1285                                     "xtype" : "ColumnModel",
1286                                     "width" : 200,
1287                                     "header" : "Comments",
1288                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1289                                     "$ xns" : "Roo.grid",
1290                                     "* prop" : "colModel[]",
1291                                     "dataIndex" : "itemsrc_comments",
1292                                     "items" : [
1293                                         {
1294                                             "xtype" : "GridEditor",
1295                                             "$ xns" : "Roo.grid",
1296                                             "* prop" : "editor",
1297                                             "items" : [
1298                                                 {
1299                                                     "xtype" : "TextField",
1300                                                     "$ xns" : "Roo.form",
1301                                                     "* prop" : "field"
1302                                                 }
1303                                             ]
1304                                         }
1305                                     ]
1306                                 },
1307                                 {
1308                                     "xtype" : "ColumnModel",
1309                                     "width" : 50,
1310                                     "header" : "UOM",
1311                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1312                                     "$ xns" : "Roo.grid",
1313                                     "* prop" : "colModel[]",
1314                                     "dataIndex" : "itemsrc_vend_uom"
1315                                 },
1316                                 {
1317                                     "align" : "right",
1318                                     "xtype" : "ColumnModel",
1319                                     "header" : "Min Qty",
1320                                     "width" : 50,
1321                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1322                                     "$ xns" : "Roo.grid",
1323                                     "* prop" : "colModel[]",
1324                                     "dataIndex" : "itemsrc_minordqty",
1325                                     "items" : [
1326                                         {
1327                                             "xtype" : "GridEditor",
1328                                             "$ xns" : "Roo.grid",
1329                                             "* prop" : "editor",
1330                                             "items" : [
1331                                                 {
1332                                                     "minValue" : 0,
1333                                                     "xtype" : "NumberField",
1334                                                     "decimalPrecision" : 0,
1335                                                     "$ xns" : "Roo.form",
1336                                                     "* prop" : "field"
1337                                                 }
1338                                             ]
1339                                         }
1340                                     ]
1341                                 },
1342                                 {
1343                                     "align" : "right",
1344                                     "xtype" : "ColumnModel",
1345                                     "header" : "Lead time",
1346                                     "width" : 75,
1347                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1348                                     "$ xns" : "Roo.grid",
1349                                     "* prop" : "colModel[]",
1350                                     "dataIndex" : "itemsrc_leadtime",
1351                                     "items" : [
1352                                         {
1353                                             "xtype" : "GridEditor",
1354                                             "$ xns" : "Roo.grid",
1355                                             "* prop" : "editor",
1356                                             "items" : [
1357                                                 {
1358                                                     "minValue" : 0,
1359                                                     "xtype" : "NumberField",
1360                                                     "decimalPrecision" : 0,
1361                                                     "$ xns" : "Roo.form",
1362                                                     "* prop" : "field"
1363                                                 }
1364                                             ]
1365                                         }
1366                                     ]
1367                                 },
1368                                 {
1369                                     "xtype" : "ColumnModel",
1370                                     "width" : 50,
1371                                     "header" : "Active",
1372                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1373                                     "$ xns" : "Roo.grid",
1374                                     "* prop" : "colModel[]",
1375                                     "dataIndex" : "itemsrc_active"
1376                                 }
1377                             ]
1378                         }
1379                     ]
1380                 },
1381                 {
1382                     "listeners" : {
1383                         "|activate" : "function() {\n    _this.hpanel = this;\n    if (_this.hgrid) {\n        _this.hgrid.footer.onClick('first');\n    }\n}"
1384                     },
1385                     "region" : "center",
1386                     "fitToframe" : true,
1387                     "background" : true,
1388                     "title" : "History",
1389                     "xtype" : "GridPanel",
1390                     "fitContainer" : true,
1391                     "$ xns" : "Roo",
1392                     "tableName" : "events",
1393                     "items" : [
1394                         {
1395                             "listeners" : {
1396                                 "|render" : "function() \n{\n    _this.hgrid = this; \n    if (_this.hpanel.active) {\n       this.footer.onClick('first');\n    }\n}"
1397                             },
1398                             "autoExpandColumn" : "remarks",
1399                             "xtype" : "Grid",
1400                             "loadMask" : true,
1401                             "$ xns" : "Roo.grid",
1402                             "* prop" : "grid",
1403                             "items" : [
1404                                 {
1405                                     "listeners" : {
1406                                         "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}"
1407                                     },
1408                                     "xtype" : "Store",
1409                                     "remoteSort" : true,
1410                                     "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }",
1411                                     "$ xns" : "Roo.data",
1412                                     "* prop" : "dataSource",
1413                                     "items" : [
1414                                         {
1415                                             "$ url" : "baseURL + '/Roo/events.php'",
1416                                             "method" : "GET",
1417                                             "xtype" : "HttpProxy",
1418                                             "$ xns" : "Roo.data",
1419                                             "* prop" : "proxy"
1420                                         },
1421                                         {
1422                                             "id" : "id",
1423                                             "root" : "data",
1424                                             "xtype" : "JsonReader",
1425                                             "$ 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]",
1426                                             "$ xns" : "Roo.data",
1427                                             "* prop" : "reader",
1428                                             "totalProperty" : "total"
1429                                         }
1430                                     ]
1431                                 },
1432                                 {
1433                                     "pageSize" : 25,
1434                                     "xtype" : "PagingToolbar",
1435                                     "emptyMsg" : "No Events found",
1436                                     "$ xns" : "Roo",
1437                                     "displayMsg" : "Displaying events{0} - {1} of {2}",
1438                                     "displayInfo" : true,
1439                                     "* prop" : "footer"
1440                                 },
1441                                 {
1442                                     "xtype" : "ColumnModel",
1443                                     "width" : 120,
1444                                     "header" : "Changed",
1445                                     "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
1446                                     "$ xns" : "Roo.grid",
1447                                     "* prop" : "colModel[]",
1448                                     "dataIndex" : "event_when"
1449                                 },
1450                                 {
1451                                     "xtype" : "ColumnModel",
1452                                     "width" : 200,
1453                                     "header" : "Action",
1454                                     "$ renderer" : "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
1455                                     "$ xns" : "Roo.grid",
1456                                     "* prop" : "colModel[]",
1457                                     "dataIndex" : "action"
1458                                 },
1459                                 {
1460                                     "xtype" : "ColumnModel",
1461                                     "width" : 200,
1462                                     "header" : "IP Address",
1463                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1464                                     "$ xns" : "Roo.grid",
1465                                     "* prop" : "colModel[]",
1466                                     "dataIndex" : "ipaddr"
1467                                 },
1468                                 {
1469                                     "xtype" : "ColumnModel",
1470                                     "width" : 75,
1471                                     "header" : "Who",
1472                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1473                                     "$ xns" : "Roo.grid",
1474                                     "* prop" : "colModel[]",
1475                                     "dataIndex" : "person_id_name"
1476                                 },
1477                                 {
1478                                     "xtype" : "ColumnModel",
1479                                     "width" : 200,
1480                                     "header" : "Notes",
1481                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
1482                                     "$ xns" : "Roo.grid",
1483                                     "* prop" : "colModel[]",
1484                                     "dataIndex" : "remarks"
1485                                 }
1486                             ]
1487                         }
1488                     ]
1489                 },
1490                 {
1491                     "listeners" : {
1492                         "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
1493                     },
1494                     "text" : "Cancel",
1495                     "xtype" : "Button",
1496                     "$ xns" : "Roo",
1497                     "* prop" : "buttons[]"
1498                 },
1499                 {
1500                     "listeners" : {
1501                         "render" : "function (_self)\n{\n    _this.saveBtn = this;\n}",
1502                         "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    \n  //  _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
1503                     },
1504                     "text" : "Save",
1505                     "xtype" : "Button",
1506                     "$ xns" : "Roo",
1507                     "* prop" : "buttons[]"
1508                 }
1509             ]
1510         }
1511     ]
1512 }