{ "id": "roo-file-18", "name": "Pman.Dialog.XtupleProdcat", "parent": "", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleProdcat.bjs", "items": [ { "closable": false, "collapsible": false, "height": 400, "modal": true, "resizable": false, "title": "Edit / Create Product Category", "width": 450, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "region": "center", "xtype": "ContentPanel", "|xns": "Roo", "items": [ { "listeners": { "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n if(_this.data.prodcat_id){\n _this.dialog.el.mask(\"Loading\");\n this.load({ method: 'GET', params: { '_id' : _this.data.prodcat_id, '_with_salesaccnt' : 1 }}); \n }\n \n _this.form.findField('salesaccnt_sales_accnt_id_descrip').setValue('');\n _this.form.findField('salesaccnt_credit_accnt_id_descrip').setValue('');\n _this.form.findField('salesaccnt_cos_accnt_id_descrip').setValue('');\n return;\n }\n if (action.type == 'load') {\n _this.dialog.el.unmask();\n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\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", "|rendered": "function (form)\n{\n _this.form= form;\n}\n" }, "labelWidth": 150, "method": "POST", "style": "margin:10px;", "xtype": "Form", "|url": "baseURL + '/Roo/Prodcat.php'", "|xns": "Roo.form", "items": [ { "legend": "Product Category Detail", "style": "width:380px", "xtype": "FieldSet", "|xns": "Roo.form", "items": [ { "allowBlank": false, "fieldLabel": "Category Code", "name": "prodcat_code", "width": 200, "xtype": "TextField", "|xns": "Roo.form" }, { "allowBlank": false, "fieldLabel": "Category Description", "name": "prodcat_descrip", "width": 200, "xtype": "TextField", "|xns": "Roo.form" } ] }, { "legend": "Account Setting", "style": "width:380px", "xtype": "FieldSet", "|xns": "Roo.form", "items": [ { "labelWidth": 150, "xtype": "Row", "|xns": "Roo.form", "items": [ { "listeners": { "beforeselect": "function (combo, record, index)\n{\n _this.form.findField('salesaccnt_sales_accnt_id_descrip').setValue(record.data.accnt_descrip);\n}" }, "allowBlank": false, "displayField": "accnt_name", "editable": true, "emptyText": "Select Account", "fieldLabel": "Inventory Sales Account", "forceSelection": true, "hiddenName": "salesaccnt_sales_accnt_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "salesaccnt_sales_accnt_id_name", "pageSize": 20, "qtip": "Select Account", "queryParam": "search[name]", "selectOnFocus": true, "tpl": "
{accnt_name} ( {accnt_descrip} )
", "triggerAction": "all", "typeAhead": true, "valueField": "accnt_id", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.accnt_active = 1;\n o.params.accnt_type = 'R';\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'accnt_id' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/accnt.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "accnt_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[{\"name\":\"accnt_id\",\"type\":\"int\"},{\"name\":\"accnt_descrip\",\"type\":\"string\"}]", "|xns": "Roo.data" } ] } ] } ] }, { "height": 30, "hideLabels": true, "style": "margin-left:155px;", "xtype": "Row", "|xns": "Roo.form", "items": [ { "name": "salesaccnt_sales_accnt_id_descrip", "width": 200, "xtype": "DisplayField", "|xns": "Roo.form" } ] }, { "labelWidth": 150, "xtype": "Row", "|xns": "Roo.form", "items": [ { "listeners": { "beforeselect": "function (combo, record, index)\n{\n _this.form.findField('salesaccnt_credit_accnt_id_descrip').setValue(record.data.accnt_descrip);\n}" }, "allowBlank": false, "displayField": "accnt_name", "editable": true, "emptyText": "Select Account", "fieldLabel": "Credit Memo Account", "forceSelection": true, "hiddenName": "salesaccnt_credit_accnt_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "salesaccnt_credit_accnt_id_name", "pageSize": 20, "qtip": "Select Account", "queryParam": "search[name]", "selectOnFocus": true, "tpl": "
{accnt_name} ( {accnt_descrip} )
", "triggerAction": "all", "typeAhead": true, "valueField": "accnt_id", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.accnt_active = 1;\n o.params.accnt_type = 'R';\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'accnt_id' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/accnt.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "accnt_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[{\"name\":\"accnt_id\",\"type\":\"int\"},{\"name\":\"accnt_descrip\",\"type\":\"string\"}]", "|xns": "Roo.data" } ] } ] } ] }, { "height": 30, "hideLabels": true, "style": "margin-left:155px;", "xtype": "Row", "|xns": "Roo.form", "items": [ { "name": "salesaccnt_credit_accnt_id_descrip", "width": 200, "xtype": "DisplayField", "|xns": "Roo.form" } ] }, { "labelWidth": 150, "xtype": "Row", "|xns": "Roo.form", "items": [ { "listeners": { "beforeselect": "function (combo, record, index)\n{\n _this.form.findField('salesaccnt_cos_accnt_id_descrip').setValue(record.data.accnt_descrip);\n}" }, "allowBlank": false, "displayField": "accnt_name", "editable": true, "emptyText": "Select Account", "fieldLabel": "Cost of Sales Account", "forceSelection": true, "hiddenName": "salesaccnt_cos_accnt_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "salesaccnt_cos_accnt_id_name", "pageSize": 20, "qtip": "Select Account", "queryParam": "search[name]", "selectOnFocus": true, "tpl": "
{accnt_name} ( {accnt_descrip} )
", "triggerAction": "all", "typeAhead": true, "valueField": "accnt_id", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.accnt_active = 1;\n o.params.accnt_type = 'E';\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'accnt_id' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/accnt.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "accnt_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[{\"name\":\"accnt_id\",\"type\":\"int\"},{\"name\":\"accnt_descrip\",\"type\":\"string\"}]", "|xns": "Roo.data" } ] } ] } ] }, { "height": 30, "hideLabels": true, "style": "margin-left:155px;", "xtype": "Row", "|xns": "Roo.form", "items": [ { "name": "salesaccnt_cos_accnt_id_descrip", "width": 200, "xtype": "DisplayField", "|xns": "Roo.form" } ] } ] }, { "name": "prodcat_id", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "salesaccnt_id", "xtype": "Hidden", "|xns": "Roo.form" } ] } ] }, { "listeners": { "click": "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "*prop": "buttons[]", "text": "Cancel", "xtype": "Button", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n // do some checks?\n \n \n // _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}" }, "*prop": "buttons[]", "text": "Save", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }