Ext.define('TradePortal.view.orders.OrderGrid', {
	alias:    'widget.ordergrid',
	extend:   'Ext.ux.LiveSearchGridPanel',
	id:       'order_grid',
	store:    'QuoteOrders',
	border:   false,
	plugins:  [Ext.create('Ext.grid.plugin.CellEditing', {
		clicksToEdit: 1
	})],
	height:   window.innerHeight - 205,
	columns:  [{
		header:    'Order Number',
		dataIndex: 'transactionNumber',
		flex:      1,
		renderer:  function (value, meta) {
			meta.tdCls += ' column-hyperlink';
			return value;
		}
	}, {
		header:    'Type',
		dataIndex: 'transactionType',
		flex:      1
	}, {
		header:    ' Delivery Date',
		dataIndex: 'deliveryDate',
		filter:    true,
		flex:      1,
		renderer:  Ext.util.Format.dateRenderer('d/m/Y')
	}, {
		header:    'Branch',
		dataIndex: 'branchID',
		flex:      1
	}, {
		header:    'Order Number',
		dataIndex: 'customerOrderNumber',
		flex:      1
	}, {
		header:    'Address',
		dataIndex: 'shipAddress1',
		flex:      2
	}, {
		header:    'Amount',
		dataIndex: 'transactionAmount',
		renderer:  Ext.util.Format.usMoney,
		align:     'right',
		flex:      1
	}],
	defaults: {
		draggable: false,
		hideable:  false,
		sortable:  false,
		resizable: false
	},
	filters:  [{
		ftype:  'filters',
		encode: false,
		local:  true
	}]
});