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