timeclockManagementLogGrid = function() {
	var expander = new Ext.grid.RowExpander({
		tpl: new Ext.XTemplate('<tpl if="type == &quot;time change&quot;">', '<p><b>Classification:</b> {classification}</p>', '<div class="floatleft" style="margin-right: 20px">', '<p><b>Time Start:</b> {timeStart}</p>', '<p><b>Time End:</b> {timeEnd}</p>', '</div>', '<tpl if="logAction != &quot;deleted&quot;">', '<p><b>Proposed TimeStart:</b> {proposedTimeStart}</p>', '<p><b>Proposed TimeEnd:</b> {proposedTimeEnd}</p>', '</tpl>', '</tpl>', '<tpl if="type != &quot;time change&quot;">', '<p><b>From:</b> {dateFrom}</p>', '<p><b>To:</b> {dateTo}</p>', '<p><b>Reason:</b> {reason}</p>', '</tpl>')
	});
	timeclockManagementLogGrid.superclass.constructor.call(this, {
		autoHeight: false,
		border: false,
		header: false,
		titleCollapse: true,
		autoExpandColumn: 'logEvent',
		height: 356,
		enableColumnHide: false,
		enableColumnMove: false,
		stripeRows: true,
		id: 'logGrid',
		columns: [
		expander,
		{
			xtype: 'gridcolumn',
			header: 'Event',
			sortable: true,
			resizable: true,
			dataIndex: 'event',
			id: 'logEvent'
		},
		{
			xtype: 'gridcolumn',
			header: 'User',
			sortable: true,
			resizable: true,
			width: 150,
			dataIndex: 'user',
			id: 'logUser'
		},
		{
			xtype: 'gridcolumn',
			header: 'Date and time',
			sortable: true,
			resizable: true,
			width: 140,
			dataIndex: 'myTimeStamp',
			id: 'logDateTime'
		}],
		store: new Ext.data.Store({
			url: 'main_menu/timeclock_data.json.php',
			baseParams: {
				command: 'getLogs',
				start: 0,
				limit: 15
			},
			reader: new Ext.data.JsonReader({
				root: 'logs'
			}, [{
				name: 'event'
			},
			{
				name: 'user'
			},
			{
				name: 'date'
			},
			{
				name: 'timeStart'
			},
			{
				name: 'timeEnd'
			},
			{
				name: 'proposedTimeStart'
			},
			{
				name: 'proposedTimeEnd'
			},
			{
				name: 'classification'
			},
			{
				name: 'type'
			},
			{
				name: 'dateFrom'
			},
			{
				name: 'dateTo'
			},
			{
				name: 'reason'
			},
			{
				name: 'myTimeStamp'
			},
			{
				name: 'logAction'
			}]),
			autoLoad: false
		}),
		plugins: expander
	});
}
Ext.extend(timeclockManagementLogGrid, Ext.grid.GridPanel);

