Ext.define('TradePortal.view.pricebook.Grid', {
	alias : 'widget.pricebookgrid',
	extend : 'Ext.grid.GridPanel',
	id : 'pricebook_grid',
	store : 'getPriceBookInfoGrid',
	height: window.innerHeight - 375,
	selModel: Ext.create('Ext.selection.CheckboxModel'),
	border : false,
	columns : [ {
		header: 'Date',
		dataIndex: 'dateGenerated',
		filter: true,
		flex: 1,
		renderer: Ext.util.Format.dateRenderer('d/m/Y')
	}, {
		header: 'Type',
		dataIndex: 'typeGenerated',
		flex: 1,
		renderer: function (v) {
			var store = Ext.getStore('priceBookType'), record = store.getById(v);
			return record.get('name');
		}
	}, {
		header: 'Format',
		dataIndex: 'formatGenerated',
		flex: 1,
		renderer: function (v) {
			var store = Ext.getStore('priceBookFormat'), record = store.getById(v);
			if (record === null){
				return v;
			}
			else{
				return record.get('name');
			}

		}
	}, {
		header: 'New Prod Codes',
		xtype : 'checkcolumn',
		disabled : true,
		dataIndex: 'newCodesGenerated',
		flex: 1
	}, {
		header: 'Core Prod',
		xtype : 'checkcolumn',
		disabled : true,
		dataIndex: 'coreProductsGenerated',
		flex: 1
	}, {
		header: 'Sent to',
		dataIndex: 'sentRecipient',
		flex: 2
	} ],
	defaults: {
		draggable: false,
		hideable: false,
		sortable: false,
		resizable: false
	}
});
