"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,
- "region" : "center",
"title" : "Terms",
"xtype" : "GridPanel",
"fitContainer" : true,
"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",
+ "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",
"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"
}
]
},
},
"xtype" : "Store",
"remoteSort" : true,
- "$ sortInfo" : "{ field : 'crdate', direction: 'ASC' }",
+ "$ sortInfo" : "{ field : 'terms_id', direction: 'ASC' }",
"$ xns" : "Roo.data",
"* prop" : "dataSource",
"items" : [
{
"$ url" : "baseURL + '/Roo/terms.php'",
- "xtype" : "HttpProxy",
"method" : "GET",
+ "xtype" : "HttpProxy",
"$ xns" : "Roo.data",
"* prop" : "proxy"
},
},
{
"xtype" : "ColumnModel",
- "header" : "ID#",
"width" : 75,
+ "header" : "ID#",
"$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
},
{
"xtype" : "ColumnModel",
- "width" : 150,
"header" : "Code",
+ "width" : 150,
"$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
},
{
"xtype" : "ColumnModel",
- "header" : "Description",
"width" : 150,
+ "header" : "Description",
"$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
},
{
"xtype" : "ColumnModel",
- "width" : 75,
"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,
},
{
"xtype" : "ColumnModel",
- "width" : 100,
"header" : "Due Days",
- "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
+ "width" : 100,
+ "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "width" : 100,
"header" : "Discount Days",
- "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
+ "width" : 100,
+ "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "width" : 100,
"header" : "Cut Off Days",
- "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
+ "width" : 100,
+ "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "width" : 150,
"header" : "Used in Payables",
+ "width" : 150,
"$ renderer" : "function(v) { \n var state = v ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
},
{
"xtype" : "ColumnModel",
- "header" : "Used in Receivables",
"width" : 150,
+ "header" : "Used in Receivables",
"$ renderer" : "function(v) { \n var state = v ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,