2 "name" : "Pman.Dialog.XtupleItem",
5 "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleItem.bjs",
11 "show" : "function (_self)\n{\n _this.dialog.layout.getRegion('center').showPanel(0);\n}"
14 "collapsible" : false,
15 "title" : "Edit / Create item",
16 "xtype" : "LayoutDialog",
24 "alwaysShowTabs" : true,
25 "xtype" : "LayoutRegion",
26 "tabPosition" : "top",
32 "xtype" : "ContentPanel",
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 _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",
39 "|rendered" : "function (form)\n{\n _this.form= form;\n}\n"
41 "$ url" : "baseURL + '/Roo/item.php'",
42 "style" : "margin:10px;",
50 "xtype" : "TextField",
54 "name" : "item_number"
57 "fieldLabel" : "Description",
58 "xtype" : "TextField",
61 "name" : "item_descrip1"
64 "fieldLabel" : "Description (2)",
65 "xtype" : "TextField",
68 "name" : "item_descrip2"
77 "beforeselect" : "function (combo, record, index)\n{\n (function() { combo.showHide(); }).defer(100);\n}"
80 "triggerAction" : "all",
81 "fieldLabel" : "Type",
82 "displayField" : "fname",
83 "emptyText" : "Select Type",
84 "hiddenName" : "item_type",
85 "valueField" : "ftype",
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\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",
93 "name" : "item_type_name",
94 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
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",
107 "triggerAction" : "all",
108 "fieldLabel" : "Class",
109 "forceSelection" : true,
110 "selectOnFocus" : true,
112 "displayField" : "classcode_code",
113 "emptyText" : "Select classcode",
114 "hiddenName" : "item_classcode_id",
116 "valueField" : "classcode_id",
117 "xtype" : "ComboBox",
118 "allowBlank" : false,
122 "$ xns" : "Roo.form",
123 "name" : "item_classcode_id_classcode_code",
124 "qtip" : "Select classcode",
126 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>",
127 "loadingText" : "Searching...",
131 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
135 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
136 "$ xns" : "Roo.data",
140 "$ url" : "baseURL + '/Roo/classcode.php'",
141 "xtype" : "HttpProxy",
143 "$ xns" : "Roo.data",
149 "xtype" : "JsonReader",
150 "$ xns" : "Roo.data",
151 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"classcode_code\",\"type\":\"string\"}]",
153 "totalProperty" : "total"
161 "triggerAction" : "all",
162 "fieldLabel" : "Invoice UOM",
163 "forceSelection" : true,
164 "selectOnFocus" : true,
166 "displayField" : "uom_descrip",
167 "emptyText" : "Select uom",
168 "hiddenName" : "item_inv_uom_id",
170 "valueField" : "uom_id",
171 "xtype" : "ComboBox",
172 "allowBlank" : false,
176 "$ xns" : "Roo.form",
177 "name" : "item_inv_uom_id_uom_descrip",
178 "qtip" : "Select classcode",
180 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>",
181 "loadingText" : "Searching...",
185 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
189 "$ sortInfo" : "{ direction : 'ASC', field: 'uom_name' }",
190 "$ xns" : "Roo.data",
194 "$ url" : "baseURL + '/Roo/uom.php'",
195 "xtype" : "HttpProxy",
197 "$ xns" : "Roo.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]",
207 "totalProperty" : "total"
215 "triggerAction" : "all",
216 "fieldLabel" : "Price UOM",
217 "forceSelection" : true,
218 "selectOnFocus" : true,
220 "displayField" : "uom_descrip",
221 "emptyText" : "Select uom",
222 "hiddenName" : "item_price_uom_id",
224 "valueField" : "uom_id",
225 "xtype" : "ComboBox",
226 "allowBlank" : false,
230 "$ xns" : "Roo.form",
231 "name" : "item_price_uom_id_uom_descrip",
232 "qtip" : "Select classcode",
234 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>",
235 "loadingText" : "Searching...",
239 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
243 "$ sortInfo" : "{ direction : 'ASC', field: 'uom_name' }",
244 "$ xns" : "Roo.data",
248 "$ url" : "baseURL + '/Roo/uom.php'",
250 "xtype" : "HttpProxy",
251 "$ xns" : "Roo.data",
257 "xtype" : "JsonReader",
258 "$ xns" : "Roo.data",
259 "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"uom_name\",\"type\":\"string\"},\n {\"name\":\"uom_descrip\",\"type\":\"string\"},\n]",
261 "totalProperty" : "total"
268 "fieldLabel" : "Weight",
269 "xtype" : "NumberField",
270 "allowBlank" : false,
271 "allowDecimals" : true,
272 "decimalPrecision" : 2,
274 "$ xns" : "Roo.form",
275 "name" : "item_prodweight"
278 "fieldLabel" : "Item comments",
279 "xtype" : "TextArea",
281 "$ xns" : "Roo.form",
282 "name" : "item_comments",
286 "fieldLabel" : "Item sold",
288 "xtype" : "Checkbox",
291 "$ xns" : "Roo.form",
295 "fieldLabel" : "Item active",
297 "xtype" : "Checkbox",
300 "$ xns" : "Roo.form",
301 "name" : "item_active"
305 "add" : "function (combo)\n{\n Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});\n}",
306 "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}"
308 "alwaysQuery" : true,
310 "triggerAction" : "all",
311 "fieldLabel" : "Product Category",
312 "forceSelection" : true,
313 "selectOnFocus" : true,
315 "displayField" : "prodcat_code",
316 "emptyText" : "Select Category",
317 "hiddenName" : "item_prodcat_id",
319 "valueField" : "prodcat_id",
320 "xtype" : "ComboBox",
321 "allowBlank" : false,
325 "$ xns" : "Roo.form",
326 "name" : "item_prodcat_id_prodcat_code",
327 "qtip" : "Select prodcat",
329 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>",
330 "loadingText" : "Searching...",
334 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
338 "$ xns" : "Roo.data",
339 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
343 "$ url" : "baseURL + '/Roo/prodcat.php'",
345 "xtype" : "HttpProxy",
346 "$ xns" : "Roo.data",
352 "xtype" : "JsonReader",
353 "$ xns" : "Roo.data",
354 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"prodcat_code\",\"type\":\"string\"}]",
356 "totalProperty" : "total"
363 "fieldLabel" : "Sales Account",
364 "xtype" : "DisplayField",
365 "$ xns" : "Roo.form",
366 "name" : "item_salesaccnt"
369 "fieldLabel" : "Item listprice",
370 "xtype" : "NumberField",
372 "$ xns" : "Roo.form",
373 "name" : "item_listprice"
377 "render" : "function (_self)\n{\n _this.standardCostFieldSet = _self;\n}"
379 "xtype" : "FieldSet",
380 "legend" : "Standard Cost",
381 "style" : "width:320px",
382 "$ xns" : "Roo.form",
386 "triggerAction" : "all",
387 "fieldLabel" : "Currency",
388 "forceSelection" : true,
389 "selectOnFocus" : true,
391 "displayField" : "curr_name",
392 "emptyText" : "Select Currency",
393 "hiddenName" : "item_itemcost_id_itemcost_curr_id",
395 "valueField" : "curr_id",
396 "xtype" : "ComboBox",
397 "allowBlank" : false,
401 "$ xns" : "Roo.form",
402 "name" : "curr_name",
403 "qtip" : "Select Currency",
404 "queryParam" : "query[curr_name]",
405 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
406 "loadingText" : "Searching...",
410 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n"
414 "$ sortInfo" : "{ direction : 'ASC', field: 'curr_symbol' }",
415 "$ xns" : "Roo.data",
419 "$ url" : "baseURL + '/Roo/curr_symbol.php'",
421 "xtype" : "HttpProxy",
422 "$ xns" : "Roo.data",
428 "xtype" : "JsonReader",
429 "$ xns" : "Roo.data",
430 "$ fields" : "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]",
432 "totalProperty" : "total"
439 "fieldLabel" : "Value",
440 "xtype" : "NumberField",
441 "allowBlank" : false,
443 "$ xns" : "Roo.form",
444 "name" : "item_itemcost_id_itemcost_actcost"
452 "$ xns" : "Roo.form",
456 "render" : "function (_self)\n{\n _this.itemsiteFieldSet = _self;\n}"
458 "xtype" : "FieldSet",
459 "legend" : "Itemsite Settings",
460 "$ xns" : "Roo.form",
461 "String/Object/Function style" : "width:335px;",
462 "Number labelWidth" : 120,
465 "fieldLabel" : "Reorder Level",
466 "xtype" : "NumberField",
467 "allowBlank" : false,
469 "$ xns" : "Roo.form",
470 "name" : "item_itemsite_id_itemsite_reorderlevel"
473 "fieldLabel" : "Stock Safety Level",
474 "xtype" : "NumberField",
475 "allowBlank" : false,
477 "$ xns" : "Roo.form",
478 "name" : "item_itemsite_id_itemsite_safetystock"
481 "fieldLabel" : "Lead time (Days)",
482 "xtype" : "NumberField",
483 "allowBlank" : false,
485 "$ xns" : "Roo.form",
486 "name" : "item_itemsite_id_itemsite_leadtime"
490 "triggerAction" : "all",
491 "fieldLabel" : "Control Method",
492 "displayField" : "fname",
493 "hiddenName" : "item_itemsite_id_itemsite_controlmethod",
494 "valueField" : "ftype",
495 "xtype" : "ComboBox",
496 "allowBlank" : false,
499 "$ xns" : "Roo.form",
501 "name" : "item_itemsite_id_itemsite_controlmethod_name",
502 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
505 "xtype" : "SimpleStore",
506 "$ data" : "[ \n [ 'N', \"None\"],\n [ 'R' , \"Regular\"]\n]\n",
507 "$ fields" : "[ 'ftype', 'fname']",
508 "$ xns" : "Roo.data",
515 "triggerAction" : "all",
516 "fieldLabel" : "Planner Code",
517 "forceSelection" : true,
518 "selectOnFocus" : true,
520 "displayField" : "plancode_name",
521 "emptyText" : "Select plancode",
522 "hiddenName" : "item_itemsite_id_itemsite_plancode_id",
524 "valueField" : "plancode_id",
525 "xtype" : "ComboBox",
526 "allowBlank" : false,
530 "$ xns" : "Roo.form",
531 "name" : "plancode_name",
532 "qtip" : "Select plancode",
534 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>",
535 "loadingText" : "Searching...",
539 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
543 "$ xns" : "Roo.data",
544 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
548 "$ url" : "baseURL + '/Roo/plancode.php'",
550 "xtype" : "HttpProxy",
551 "$ xns" : "Roo.data",
557 "xtype" : "JsonReader",
558 "$ xns" : "Roo.data",
559 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"plancode_code\",\"type\":\"string\"}]",
561 "totalProperty" : "total"
569 "triggerAction" : "all",
570 "fieldLabel" : "Costcat",
571 "forceSelection" : true,
572 "selectOnFocus" : true,
574 "displayField" : "costcat_code",
575 "emptyText" : "Select costcat",
576 "hiddenName" : "item_itemsite_id_itemsite_costcat_id",
578 "valueField" : "costcat_id",
579 "xtype" : "ComboBox",
580 "allowBlank" : false,
584 "$ xns" : "Roo.form",
585 "name" : "costcat_code",
586 "qtip" : "Select costcat",
588 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>",
589 "loadingText" : "Searching...",
593 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
597 "$ xns" : "Roo.data",
598 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
602 "$ url" : "baseURL + '/Roo/costcat.php'",
604 "xtype" : "HttpProxy",
605 "$ xns" : "Roo.data",
611 "xtype" : "JsonReader",
612 "$ xns" : "Roo.data",
613 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"costcat_code\",\"type\":\"string\"}]",
615 "totalProperty" : "total"
622 "fieldLabel" : "Active",
624 "xtype" : "Checkbox",
627 "$ xns" : "Roo.form",
628 "name" : "item_itemsite_id_itemsite_active"
631 "fieldLabel" : "Sold",
633 "xtype" : "Checkbox",
636 "$ xns" : "Roo.form",
637 "name" : "item_itemsite_id_itemsite_sold"
640 "fieldLabel" : "Stocked",
642 "xtype" : "Checkbox",
645 "$ xns" : "Roo.form",
646 "name" : "item_itemsite_id_itemsite_stocked"
649 "fieldLabel" : "Perishable",
651 "xtype" : "Checkbox",
654 "$ xns" : "Roo.form",
655 "name" : "item_itemsite_id_itemsite_perishable"
658 "fieldLabel" : "Multi Location",
660 "xtype" : "Checkbox",
663 "$ xns" : "Roo.form",
664 "name" : "item_itemsite_id_itemsite_loccntrl"
668 "triggerAction" : "all",
669 "fieldLabel" : "Default Location",
670 "forceSelection" : true,
671 "selectOnFocus" : true,
673 "displayField" : "location_name",
674 "emptyText" : "Default Location",
675 "hiddenName" : "item_itemsite_id_itemsite_location_id",
677 "valueField" : "location_id",
678 "xtype" : "ComboBox",
679 "allowBlank" : false,
683 "$ xns" : "Roo.form",
684 "name" : "location_name",
685 "qtip" : "Select terms",
686 "queryParam" : "query[location_name]",
687 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
688 "loadingText" : "Searching...",
692 "|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"
696 "$ sortInfo" : "{ direction : 'ASC', field: 'location_name' }",
697 "$ xns" : "Roo.data",
701 "$ url" : "baseURL + '/Roo/location.php'",
702 "xtype" : "HttpProxy",
704 "$ xns" : "Roo.data",
708 "id" : "location_id",
710 "xtype" : "JsonReader",
711 "$ fields" : "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
712 "$ xns" : "Roo.data",
714 "totalProperty" : "total"
727 "$ xns" : "Roo.form",
736 "|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}"
741 "title" : "Item Parts",
742 "xtype" : "GridPanel",
743 "fitContainer" : true,
745 "tableName" : "bomitem",
749 "beforeedit" : "function (e)\n{\n if(e.field != 'bomitem_qtyper'){\n return false;\n }\n \n}",
750 "|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}",
751 "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}"
753 "autoExpandColumn" : "bomitem_item_id_item_descrip1",
754 "xtype" : "EditorGrid",
757 "$ xns" : "Roo.grid",
763 "* prop" : "toolbar",
767 "render" : "function (_self)\n{\n _this.partsBox = _self;\n}",
768 "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}"
770 "alwaysQuery" : true,
771 "triggerAction" : "all",
772 "fieldLabel" : "Item",
773 "forceSelection" : true,
774 "selectOnFocus" : true,
776 "displayField" : "item_number",
777 "emptyText" : "Select item",
780 "xtype" : "ComboBox",
785 "$ xns" : "Roo.bootstrap",
786 "qtip" : "Select item",
787 "queryParam" : "query[number_or_name]",
788 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>",
789 "loadingText" : "Searching...",
793 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n \n o.params.item_active = 1;\n o.params['!item_type'] = 'K';\n}\n"
797 "$ sortInfo" : "{ direction : 'ASC', field: 'item_number' }",
798 "$ xns" : "Roo.data",
802 "$ url" : "baseURL + '/Roo/item.php'",
803 "xtype" : "HttpProxy",
805 "$ xns" : "Roo.data",
811 "xtype" : "JsonReader",
812 "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"item_number\",\"type\":\"string\"}\n]",
813 "$ xns" : "Roo.data",
815 "totalProperty" : "total"
823 "$ xns" : "Roo.Toolbar"
827 "|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}"
831 "cls" : "x-btn-text-icon",
832 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
839 "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}"
843 "$ sortInfo" : "{ field : 'bomitem_item_id_item_name', direction: 'ASC' }",
844 "$ xns" : "Roo.data",
845 "* prop" : "dataSource",
848 "$ url" : "baseURL + '/Roo/bomitem.php'",
850 "xtype" : "HttpProxy",
851 "$ xns" : "Roo.data",
857 "xtype" : "JsonReader",
858 "$ fields" : "[\n {\n 'name': 'bomitem_id',\n 'type': 'int'\n }\n]",
859 "$ xns" : "Roo.data",
861 "totalProperty" : "total"
867 "xtype" : "PagingToolbar",
868 "emptyMsg" : "Nothing found",
870 "displayMsg" : "Displaying parts {0} - {1} of {2}",
871 "displayInfo" : true,
875 "xtype" : "ColumnModel",
878 "$ renderer" : "function(v) { return String.format('{0}', v); }",
879 "$ xns" : "Roo.grid",
880 "* prop" : "colModel[]",
881 "dataIndex" : "bomitem_item_id_item_number"
884 "xtype" : "ColumnModel",
886 "header" : "Description",
887 "$ renderer" : "function(v) { return String.format('{0}', v); }",
888 "$ xns" : "Roo.grid",
889 "* prop" : "colModel[]",
890 "dataIndex" : "bomitem_item_id_item_descrip1"
893 "xtype" : "ColumnModel",
894 "String align" : "right",
897 "$ renderer" : "function(v) { return String.format('{0}', v); }",
898 "$ xns" : "Roo.grid",
899 "* prop" : "colModel[]",
900 "dataIndex" : "bomitem_qtyper",
903 "xtype" : "GridEditor",
904 "$ xns" : "Roo.grid",
908 "Boolean allowBlank" : false,
909 "String cls" : "align-right",
910 "xtype" : "NumberField",
911 "Number decimalPrecision" : 0,
912 "$ xns" : "Roo.form",
914 "Number minValue" : 0
926 "|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}"
931 "title" : "Reference Files",
932 "xtype" : "GridPanel",
933 "fitContainer" : true,
935 "tableName" : "Images",
939 "|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}",
940 "|render" : "function() { \n _this.grid = this; \n\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}"
942 "autoExpandColumn" : "id",
945 "$ xns" : "Roo.grid",
950 "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}"
954 "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }",
955 "$ xns" : "Roo.data",
956 "* prop" : "dataSource",
961 "xtype" : "JsonReader",
962 "$ 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]",
963 "$ xns" : "Roo.data",
965 "totalProperty" : "total"
968 "$ url" : "baseURL + '/Roo/Images.php'",
970 "xtype" : "HttpProxy",
971 "$ xns" : "Roo.data",
978 "xtype" : "PagingToolbar",
979 "emptyMsg" : "No Images found",
981 "displayInfo" : true,
982 "displayMsg" : "Displaying Images {0} - {1} of {2}",
988 "* prop" : "toolbar",
992 "|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} "
996 "cls" : "x-btn-text-icon",
997 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
998 "$ xns" : "Roo.Toolbar"
1002 "|click" : "function()\n{\n Pman.genericDelete(_this, 'Images'); \n}\n "
1006 "cls" : "x-btn-text-icon",
1007 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
1008 "$ xns" : "Roo.Toolbar"
1013 "xtype" : "ColumnModel",
1015 "header" : "Created",
1017 "$ 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 ",
1018 "$ xns" : "Roo.grid",
1019 "* prop" : "colModel[]",
1020 "dataIndex" : "created"
1023 "xtype" : "ColumnModel",
1026 "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" height=\"100\">', baseURL, v, r.data.filename); }",
1027 "$ xns" : "Roo.grid",
1028 "* prop" : "colModel[]",
1037 "|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}"
1039 "fitToframe" : true,
1040 "background" : true,
1041 "region" : "center",
1042 "title" : "Price List",
1043 "xtype" : "GridPanel",
1044 "fitContainer" : true,
1046 "tableName" : "ipshead",
1050 "beforeedit" : "function (e)\n{\n if(e.field != 'ipshead_ipsitem_price'){\n return false;\n }\n \n}",
1051 "|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}",
1052 "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}"
1054 "autoExpandColumn" : "ipshead_descrip",
1055 "xtype" : "EditorGrid",
1058 "$ xns" : "Roo.grid",
1063 "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}"
1066 "remoteSort" : true,
1067 "$ sortInfo" : "{ field : 'ipshead_id', direction: 'ASC' }",
1068 "$ xns" : "Roo.data",
1069 "* prop" : "dataSource",
1072 "$ url" : "baseURL + '/Roo/ipshead.php'",
1073 "xtype" : "HttpProxy",
1075 "$ xns" : "Roo.data",
1079 "id" : "ipshead_id",
1081 "xtype" : "JsonReader",
1082 "$ fields" : "[\n {\n 'name': 'ipshead_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_name',\n 'type': 'string'\n }\n]",
1083 "$ xns" : "Roo.data",
1084 "* prop" : "reader",
1085 "totalProperty" : "total"
1091 "xtype" : "PagingToolbar",
1092 "emptyMsg" : "Nothing found",
1094 "displayMsg" : "Displaying records {0} - {1} of {2}",
1095 "displayInfo" : true,
1099 "xtype" : "ColumnModel",
1102 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1103 "$ xns" : "Roo.grid",
1104 "* prop" : "colModel[]",
1105 "dataIndex" : "ipshead_name"
1108 "xtype" : "ColumnModel",
1109 "header" : "Description",
1111 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1112 "$ xns" : "Roo.grid",
1113 "* prop" : "colModel[]",
1114 "dataIndex" : "ipshead_descrip"
1117 "xtype" : "ColumnModel",
1118 "header" : "Currency",
1120 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1121 "$ xns" : "Roo.grid",
1122 "* prop" : "colModel[]",
1123 "dataIndex" : "ipshead_curr_id_curr_name"
1127 "xtype" : "ColumnModel",
1130 "$ renderer" : "function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); }",
1131 "$ xns" : "Roo.grid",
1132 "* prop" : "colModel[]",
1133 "dataIndex" : "ipshead_ipsitem_price",
1136 "xtype" : "GridEditor",
1137 "$ xns" : "Roo.grid",
1138 "* prop" : "editor",
1141 "xtype" : "NumberField",
1142 "cls" : "align-right",
1143 "decimalPrecision" : 2,
1144 "$ xns" : "Roo.form",
1157 "|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}"
1159 "fitToframe" : true,
1160 "background" : true,
1161 "region" : "center",
1162 "title" : "Suppliers",
1163 "xtype" : "GridPanel",
1164 "fitContainer" : true,
1166 "tableName" : "itemsrc",
1170 "|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",
1171 "|render" : "function() \n{\n _this.itemsrcgrid = this; \n \n if (_this.itemsrcpanel.active) {\n this.footer.onClick('first');\n }\n}",
1172 "afteredit" : "function (e)\n{\n e.record.commit();\n}"
1174 "autoExpandColumn" : "itemsrc_comments",
1175 "xtype" : "EditorGrid",
1178 "$ xns" : "Roo.grid",
1183 "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}",
1184 "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}"
1187 "remoteSort" : true,
1188 "$ sortInfo" : "{ field : 'itemsrc_vend_id_vend_name', direction: 'ASC' }",
1189 "$ xns" : "Roo.data",
1190 "* prop" : "dataSource",
1193 "$ url" : "baseURL + '/Roo/itemsrc.php'",
1195 "xtype" : "HttpProxy",
1196 "$ xns" : "Roo.data",
1202 "xtype" : "JsonReader",
1203 "$ xns" : "Roo.data",
1204 "$ 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]",
1205 "* prop" : "reader",
1206 "totalProperty" : "total"
1212 "xtype" : "PagingToolbar",
1213 "emptyMsg" : "No itemsrc found",
1215 "displayInfo" : true,
1216 "displayMsg" : "Displaying itemsrc{0} - {1} of {2}",
1220 "xtype" : "Toolbar",
1222 "* prop" : "toolbar",
1226 "|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"
1230 "cls" : "x-btn-text-icon",
1231 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1232 "$ xns" : "Roo.Toolbar"
1237 "xtype" : "ColumnModel",
1238 "header" : "Vendor",
1240 "$ renderer" : "function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); }",
1241 "$ xns" : "Roo.grid",
1242 "* prop" : "colModel[]",
1243 "dataIndex" : "itemsrc_vend_id",
1246 "xtype" : "GridEditor",
1247 "$ xns" : "Roo.grid",
1248 "* prop" : "editor",
1252 "triggerAction" : "all",
1253 "forceSelection" : true,
1254 "selectOnFocus" : true,
1256 "displayField" : "vend_name",
1257 "emptyText" : "Select Vendor",
1258 "hiddenName" : "itemsrc_vend_id",
1260 "valueField" : "vend_id",
1261 "xtype" : "ComboBox",
1262 "allowBlank" : false,
1266 "$ xns" : "Roo.form",
1268 "name" : "itemsrc_vend_id_vend_name",
1269 "qtip" : "Select vendinfo",
1270 "queryParam" : "q[search]",
1271 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>",
1272 "loadingText" : "Searching...",
1276 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
1279 "remoteSort" : true,
1280 "$ xns" : "Roo.data",
1281 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1285 "$ url" : "baseURL + '/Roo/vendinfo.php'",
1287 "xtype" : "HttpProxy",
1288 "$ xns" : "Roo.data",
1294 "xtype" : "JsonReader",
1295 "$ xns" : "Roo.data",
1296 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"vend_name\",\"type\":\"string\"}]",
1297 "* prop" : "reader",
1298 "totalProperty" : "total"
1309 "xtype" : "ColumnModel",
1310 "header" : "Vendor Ref#",
1312 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1313 "$ xns" : "Roo.grid",
1314 "* prop" : "colModel[]",
1315 "dataIndex" : "itemsrc_vend_item_number",
1318 "xtype" : "GridEditor",
1319 "$ xns" : "Roo.grid",
1320 "* prop" : "editor",
1323 "xtype" : "TextField",
1324 "$ xns" : "Roo.form",
1332 "xtype" : "ColumnModel",
1333 "header" : "Comments",
1335 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1336 "$ xns" : "Roo.grid",
1337 "* prop" : "colModel[]",
1338 "dataIndex" : "itemsrc_comments",
1341 "xtype" : "GridEditor",
1342 "$ xns" : "Roo.grid",
1343 "* prop" : "editor",
1346 "xtype" : "TextField",
1347 "$ xns" : "Roo.form",
1355 "xtype" : "ColumnModel",
1358 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1359 "$ xns" : "Roo.grid",
1360 "* prop" : "colModel[]",
1361 "dataIndex" : "itemsrc_vend_uom"
1365 "xtype" : "ColumnModel",
1366 "header" : "Min Qty",
1368 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1369 "$ xns" : "Roo.grid",
1370 "* prop" : "colModel[]",
1371 "dataIndex" : "itemsrc_minordqty",
1374 "xtype" : "GridEditor",
1375 "$ xns" : "Roo.grid",
1376 "* prop" : "editor",
1380 "xtype" : "NumberField",
1381 "decimalPrecision" : 0,
1382 "$ xns" : "Roo.form",
1391 "xtype" : "ColumnModel",
1392 "header" : "Lead time",
1394 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1395 "$ xns" : "Roo.grid",
1396 "* prop" : "colModel[]",
1397 "dataIndex" : "itemsrc_leadtime",
1400 "xtype" : "GridEditor",
1401 "$ xns" : "Roo.grid",
1402 "* prop" : "editor",
1406 "xtype" : "NumberField",
1407 "decimalPrecision" : 0,
1408 "$ xns" : "Roo.form",
1416 "xtype" : "ColumnModel",
1417 "header" : "Active",
1419 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1420 "$ xns" : "Roo.grid",
1421 "* prop" : "colModel[]",
1422 "dataIndex" : "itemsrc_active"
1430 "|activate" : "function() {\n _this.hpanel = this;\n if (_this.hgrid) {\n _this.hgrid.footer.onClick('first');\n }\n}"
1432 "fitToframe" : true,
1433 "background" : true,
1434 "region" : "center",
1435 "title" : "History",
1436 "xtype" : "GridPanel",
1437 "fitContainer" : true,
1439 "tableName" : "events",
1443 "|render" : "function() \n{\n _this.hgrid = this; \n if (_this.hpanel.active) {\n this.footer.onClick('first');\n }\n}"
1445 "autoExpandColumn" : "remarks",
1448 "$ xns" : "Roo.grid",
1453 "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}"
1456 "remoteSort" : true,
1457 "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }",
1458 "$ xns" : "Roo.data",
1459 "* prop" : "dataSource",
1462 "$ url" : "baseURL + '/Roo/events.php'",
1463 "xtype" : "HttpProxy",
1465 "$ xns" : "Roo.data",
1471 "xtype" : "JsonReader",
1472 "$ 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]",
1473 "$ xns" : "Roo.data",
1474 "* prop" : "reader",
1475 "totalProperty" : "total"
1481 "xtype" : "PagingToolbar",
1482 "emptyMsg" : "No Events found",
1484 "displayMsg" : "Displaying events{0} - {1} of {2}",
1485 "displayInfo" : true,
1489 "xtype" : "ColumnModel",
1490 "header" : "Changed",
1492 "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
1493 "$ xns" : "Roo.grid",
1494 "* prop" : "colModel[]",
1495 "dataIndex" : "event_when"
1498 "xtype" : "ColumnModel",
1499 "header" : "Action",
1501 "$ renderer" : "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
1502 "$ xns" : "Roo.grid",
1503 "* prop" : "colModel[]",
1504 "dataIndex" : "action"
1507 "xtype" : "ColumnModel",
1508 "header" : "IP Address",
1510 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1511 "$ xns" : "Roo.grid",
1512 "* prop" : "colModel[]",
1513 "dataIndex" : "ipaddr"
1516 "xtype" : "ColumnModel",
1519 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1520 "$ xns" : "Roo.grid",
1521 "* prop" : "colModel[]",
1522 "dataIndex" : "person_id_name"
1525 "xtype" : "ColumnModel",
1528 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1529 "$ xns" : "Roo.grid",
1530 "* prop" : "colModel[]",
1531 "dataIndex" : "remarks"
1539 "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
1544 "* prop" : "buttons[]"
1548 "render" : "function (_self)\n{\n _this.saveBtn = this;\n}",
1549 "click" : "function (_self, e)\n{\n // do some checks?\n \n \n // _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
1554 "* prop" : "buttons[]"