{ "id": "roo-file-23", "name": "Pman.Dialog.XtuplePurchaseOrderNew", "parent": "", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtuplePurchaseOrderNew.bjs", "items": [ { "listeners": { "show": "function (_self)\n{\n _this.form.findField('pohead_vend_id').focus();\n}" }, "closable": false, "height": 180, "modal": true, "resizable": false, "title": "Pick Vendor", "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}" }, "xtype": "Form", "|xns": "Roo.form", "items": [ { "listeners": { "select": "function (combo, record, index)\n{\n \n Roo.log(record);\n _this.form.setValues({\n pohead_curr_id : record.data.vend_curr_id,\n pohead_curr_id_curr_name : record.data.vend_curr_id_curr_name\n \n });\n}", "render": "function (_self)\n{\n _this.vendor = _self;\n}" }, "allowBlank": false, "displayField": "vend_name", "editable": true, "fieldLabel": "Select Vendor", "forceSelection": true, "hiddenName": "pohead_vend_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "pohead_vend_id_vend_name", "pageSize": 20, "qtip": "Select a vendor", "queryParam": "query[vend_name]", "selectOnFocus": true, "tpl": "
{vend_name}
", "triggerAction": "all", "typeAhead": true, "valueField": "vend_id", "width": 300, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'vend_name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/Vendinfo.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "vend_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[\n {\"name\":\"vend_id\",\"type\":\"int\"},\n {\"name\":\"vend_name\",\"type\":\"string\"}\n]", "|xns": "Roo.data" } ] } ] }, { "allowBlank": false, "displayField": "curr_name", "editable": false, "emptyText": "Select Currency", "fieldLabel": "Currency", "forceSelection": true, "hiddenName": "pohead_curr_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "pohead_curr_id_curr_name", "pageSize": 20, "qtip": "Select Currency", "queryParam": "query[curr_name]", "selectOnFocus": true, "tpl": "
{curr_name}
", "triggerAction": "all", "typeAhead": true, "valueField": "curr_id", "width": 300, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'curr_id' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/curr_symbol.php'" }, { "*prop": "reader", "id": "curr_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[\n {\"name\":\"curr_id\",\"type\":\"int\"},\n {\"name\":\"curr_name\",\"type\":\"string\"}\n]", "|xns": "Roo.data" } ] } ] } ] } ] }, { "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 if (_this.form.findField('pohead_vend_id').getValue() < 1) {\n Roo.MessageBox.alert(\"Error\", \"Select a vendor\");\n return;\n }\n var last = _this.vendor.lastData;\n \n var data = _this.form.getFieldValues();\n \n data.pohead_terms_id_terms_descrip = last.vend_terms_id_terms_descrip;\n data.pohead_terms_id = last.vend_terms_id;\n \n data.pohead_taxzone_id = last.vend_taxzone_id;\n data.pohead_taxzone_id_taxzone_descrip = last.vend_taxzone_id_taxzone_descrip;\n \n _this.dialog.hide();\n _this.callback(data);\n}" }, "*prop": "buttons[]", "text": "OK", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }