}
]
},
+ {
+ "listeners": {
+ "|activate": "function() {\n _this.hpanel = this;\n if (_this.hgrid) {\n _this.hgrid.footer.onClick('first');\n }\n}"
+ },
+ "background": true,
+ "fitContainer": true,
+ "fitToframe": true,
+ "region": "center",
+ "tableName": "events",
+ "title": "History",
+ "xtype": "GridPanel",
+ "|xns": "Roo",
+ "items": [
+ {
+ "listeners": {
+ "|render": "function() \n{\n _this.hgrid = this; \n if (_this.hpanel.active) {\n this.footer.onClick('first');\n }\n}"
+ },
+ "*prop": "grid",
+ "autoExpandColumn": "remarks",
+ "loadMask": true,
+ "xtype": "Grid",
+ "|xns": "Roo.grid",
+ "items": [
+ {
+ "listeners": {
+ "beforeload": "function (_self, options)\n{\n options.params = options.params || {};\n \n options.params.on_table = 'invhist_transfer';\n options.params.on_id = _this.form.findField('invhist_transfer_id').getValue();\n}"
+ },
+ "*prop": "dataSource",
+ "remoteSort": true,
+ "xtype": "Store",
+ "|sortInfo": "{ field : 'event_when', direction: 'DESC' }",
+ "|xns": "Roo.data",
+ "items": [
+ {
+ "*prop": "proxy",
+ "method": "GET",
+ "xtype": "HttpProxy",
+ "|url": "baseURL + '/Roo/events.php'",
+ "|xns": "Roo.data"
+ },
+ {
+ "*prop": "reader",
+ "id": "id",
+ "root": "data",
+ "totalProperty": "total",
+ "xtype": "JsonReader",
+ "|fields": "[\n {\n 'name': 'event_when',\n 'type': 'date'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n }\n]",
+ "|xns": "Roo.data"
+ }
+ ]
+ },
+ {
+ "*prop": "footer",
+ "displayInfo": true,
+ "displayMsg": "Displaying events{0} - {1} of {2}",
+ "emptyMsg": "No Events found",
+ "pageSize": 25,
+ "xtype": "PagingToolbar",
+ "|xns": "Roo"
+ },
+ {
+ "*prop": "colModel[]",
+ "dataIndex": "event_when",
+ "header": "Changed",
+ "width": 120,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
+ "|xns": "Roo.grid"
+ },
+ {
+ "*prop": "colModel[]",
+ "dataIndex": "action",
+ "header": "Action",
+ "width": 200,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
+ "|xns": "Roo.grid"
+ },
+ {
+ "*prop": "colModel[]",
+ "dataIndex": "ipaddr",
+ "header": "IP Address",
+ "width": 200,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v) { return String.format('{0}', v); }",
+ "|xns": "Roo.grid"
+ },
+ {
+ "*prop": "colModel[]",
+ "dataIndex": "person_id_name",
+ "header": "Who",
+ "width": 75,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v) { return String.format('{0}', v); }",
+ "|xns": "Roo.grid"
+ },
+ {
+ "*prop": "colModel[]",
+ "dataIndex": "remarks",
+ "header": "Notes",
+ "width": 200,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v) { return String.format('{0}', v); }",
+ "|xns": "Roo.grid"
+ }
+ ]
+ }
+ ]
+ },
{
"listeners": {
"click": "function (_self, e)\n{\n new Pman.Download({\n grid : _this.grid\n });\n \n \n\n}"
}
]
}
+ },
+ {
+ xtype: 'GridPanel',
+ xns: Roo,
+ listeners : {
+ activate : function() {
+ _this.hpanel = this;
+ if (_this.hgrid) {
+ _this.hgrid.footer.onClick('first');
+ }
+ }
+ },
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'events',
+ title : "History",
+ grid : {
+ xtype: 'Grid',
+ xns: Roo.grid,
+ listeners : {
+ render : function()
+ {
+ _this.hgrid = this;
+ if (_this.hpanel.active) {
+ this.footer.onClick('first');
+ }
+ }
+ },
+ autoExpandColumn : 'remarks',
+ loadMask : true,
+ dataSource : {
+ xtype: 'Store',
+ xns: Roo.data,
+ listeners : {
+ beforeload : function (_self, options)
+ {
+ options.params = options.params || {};
+
+ options.params.on_table = 'invhist_transfer';
+ options.params.on_id = _this.form.findField('invhist_transfer_id').getValue();
+ }
+ },
+ remoteSort : true,
+ sortInfo : { field : 'event_when', direction: 'DESC' },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Roo/events.php'
+ },
+ reader : {
+ xtype: 'JsonReader',
+ xns: Roo.data,
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ fields : [
+ {
+ 'name': 'event_when',
+ 'type': 'date'
+ },
+ {
+ 'name': 'action',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ipaddr',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'remarks',
+ 'type': 'string'
+ }
+ ]
+ }
+ },
+ footer : {
+ xtype: 'PagingToolbar',
+ xns: Roo,
+ displayInfo : true,
+ displayMsg : "Displaying events{0} - {1} of {2}",
+ emptyMsg : "No Events found",
+ pageSize : 25
+ },
+ colModel : [
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'event_when',
+ header : 'Changed',
+ width : 120,
+ renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'action',
+ header : 'Action',
+ width : 200,
+ renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'ipaddr',
+ header : 'IP Address',
+ width : 200,
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'person_id_name',
+ header : 'Who',
+ width : 75,
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'remarks',
+ header : 'Notes',
+ width : 200,
+ renderer : function(v) { return String.format('{0}', v); }
+ }
+ ]
+ }
}
],
center : {