{ "id": "roo-file-36", "name": "Pman.Dialog.XtupleShipmentNew", "parent": false, "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleShipmentNew.bjs", "items": [ { "listeners": { "show": "function (_self)\n{\n _this.form.findField('shiphead_location_id').focus();\n}" }, "closable": false, "height": 130, "modal": true, "resizable": false, "title": "Create new Shipment", "width": 500, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "region": "center", "xtype": "ContentPanel", "|xns": "Roo", "items": [ { "listeners": { "rendered": "function (form)\n{\n _this.form = form;\n}", "actioncomplete": "function (_self, action)\n{\n if (action.type == 'setdata') {\n // see if there are multiple possilbe targets\n new Pman.Request({\n url : baseURL + '/Roo/cohead',\n method : 'GET',\n params : {\n cohead_id : _this.data.shiphead_order_id,\n _has_multiple_ship : 1\n },\n success : function(res) {\n // if there is one row returned, then assign values, and press OK\n // otherwise.. cary on..\n if (res.total === 1) {\n _this.form.setValues( {\n \n shiphead_location_id : res.data[0].coitem_location_src,\n shiphead_location_id_location_name : res.data[0].coitem_location_src_name, \n shiphead_shipto_id : res.data[0].coitem_shipto_id,\n shiphead_shipto_id_shipto_name : res.data[0].coitem_shipto_id_name\n });\n _this.okButton.fireEvent('click');\n }\n \n },\n failure : function(res) {\n\n Roo.MessageBox.alert(\"Error\", res.errorMsg);\n _this.dialog.hide();\n \n }\n });\n \n \n }\n \n}" }, "xtype": "Form", "|xns": "Roo.form", "items": [ { "allowBlank": false, "alwaysQuery": true, "displayField": "location_name", "editable": false, "emptyText": "Select location", "fieldLabel": "From Location", "forceSelection": true, "hiddenName": "shiphead_location_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "shiphead_location_id_location_name", "pageSize": 20, "qtip": "Select location", "queryParam": "", "selectOnFocus": true, "tpl": "
{location_name}
", "triggerAction": "all", "typeAhead": true, "valueField": "location_id", "width": 300, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n o.params['query[for_cohead_id]'] = _this.data.shiphead_order_id;\n // set more here\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'location_name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/location.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]" } ] } ] }, { "allowBlank": false, "alwaysQuery": true, "displayField": "shipto_name", "editable": false, "emptyText": "Select Ship to name", "fieldLabel": "To", "forceSelection": true, "hiddenName": "shiphead_shipto_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "shiphead_shipto_id_shipto_name", "pageSize": 20, "qtip": "Select Ship to name", "queryParam": "", "selectOnFocus": true, "tpl": "
{shipto_name}
", "triggerAction": "all", "typeAhead": true, "valueField": "shipto_id", "width": 300, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params['query[for_cohead_id]'] = _this.data.shiphead_order_id;\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'shipto_name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/shiptoinfo.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"shipto_name\",\"type\":\"string\"}]" } ] } ] }, { "name": "shiphead_order_id", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "shiphead_shipdate", "xtype": "Hidden", "|xns": "Roo.form" } ] } ] }, { "listeners": { "click": "function (_self, e)\n{\n _this.dialog.hide();\n \n }" }, "*prop": "buttons[]", "text": "Cancel", "xtype": "Button", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n //_this.findField('cuinfo_\n \n // check if customer is filled in.\n if (_this.form.findField('shiphead_location_id').getValue() < 1) {\n Roo.MessageBox.alert(\"Error\", \"Select a source location\");\n return;\n }\n if (_this.form.findField('shiphead_shipto_id').getValue() < 1) {\n Roo.MessageBox.alert(\"Error\", \"Select where to ship to\");\n return;\n }\n\n var rv = _this.form.getFieldValues();\n\n \n Pman.Dialog.XtupleShipment.show(rv ,\n function() { \n _this.dialog.hide();\n _this.callback()\n }\n );\n \n }", "render": "function (_self)\n{\n _this.okButton = _self;\n}" }, "*prop": "buttons[]", "text": "OK", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }