{ "name" : "Pman.Tab.XtupleTerms", "parent" : "Pman.Tab.XtupleAccountsTab", "title" : "", "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleTerms.bjs", "permname" : "", "modOrder" : "700", "items" : [ { "background" : false, "region" : "center", "title" : "Terms", "xtype" : "NestedLayoutPanel", "$ xns" : "Roo", "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "region" : "center", "fitToframe" : true, "background" : false, "title" : "Terms", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "terms", "items" : [ { "listeners" : { "rowdblclick" : "function (_self, rowIndex, e)\n{\n var id = this.getDataSource().getAt(rowIndex).data.terms_id * 1;\n\n if(id < 1){\n Roo.MessageBox.alert('Error', 'Please select a row');\n return;\n }\n \n Pman.Dialog.XtupleTerms.show( {id : id}, function() {\n _this.grid.footer.onClick('refresh');\n }); \n}\n", "|render" : "function() \n{\n _this.grid = this; \n \n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "terms_descrip", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "Boolean singleSelect" : true, "xtype" : "RowSelectionModel", "$ xns" : "Roo.grid", "* prop" : "sm" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}", "render" : "function (_self)\n{\n _this.searchBox = _self;\n}" }, "xtype" : "TextField", "$ xns" : "Roo.form" }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\r\n\r\n _this.grid.footer.onClick('first');\r\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", "$ xns" : "Roo.Toolbar" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function()\n{\n\n Pman.Dialog.XtupleTerms.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" }, "text" : "Add", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" }, { "xtype" : "Separator", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function()\n{\n var sel = _this.grid.getSelectionModel().getSelected();\n\n if(!sel || sel.data.terms_id * 1 < 1){\n Roo.MessageBox.alert(\"Error\", \"Please select a terms\");\n return;\n }\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete the terms?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n new Pman.Request({\n url : baseURL + '/Roo/terms.php',\n method : 'POST',\n params : {\n _delete : sel.data.terms_id * 1\n }, \n success : function(res) {\n _this.grid.footer.onClick('first');\n }\n }); \n \n return;\n }\n );\n \n}\n " }, "text" : "Delete", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "listeners" : { "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n var s = _this.searchBox.getValue();\n \n if(s.length){\n o.params['search[name]'] = s;\n }\n \n \n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'terms_id', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/terms.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\n 'name': 'terms_id',\n 'type': 'int'\n },\n {\n 'name': 'terms_code',\n 'type': 'string'\n },\n {\n 'name': 'terms_descrip',\n 'type': 'string',\n }\n]", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No terms found", "$ xns" : "Roo", "displayInfo" : true, "displayMsg" : "Displaying Terms{0} - {1} of {2}", "* prop" : "footer" }, { "xtype" : "ColumnModel", "width" : 75, "header" : "ID#", "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_id" }, { "xtype" : "ColumnModel", "header" : "Code", "width" : 150, "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_code" }, { "xtype" : "ColumnModel", "width" : 150, "header" : "Description", "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_descrip" }, { "xtype" : "ColumnModel", "header" : "Type", "width" : 75, "$ renderer" : "function(v) { \n var t = (v == 'D') ? 'Days' : 'Proximo';\n \n return String.format('{0}', t); \n}", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_type" }, { "xtype" : "ColumnModel", "header" : "Due Days", "width" : 100, "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_duedays" }, { "xtype" : "ColumnModel", "header" : "Discount Days", "width" : 100, "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_discdays" }, { "xtype" : "ColumnModel", "header" : "Cut Off Days", "width" : 100, "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_cutoffday" }, { "xtype" : "ColumnModel", "header" : "Used in Payables", "width" : 150, "$ renderer" : "function(v) { \n var state = v ? '-checked' : '';\n\n return '';\n \n }", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_ap" }, { "xtype" : "ColumnModel", "width" : 150, "header" : "Used in Receivables", "$ renderer" : "function(v) { \n var state = v ? '-checked' : '';\n\n return '';\n \n }", "$ xns" : "Roo.grid", "Boolean sortable" : true, "* prop" : "cm[]", "dataIndex" : "terms_ar" } ] } ] } ] } ] } ] }