Ext.ns('Pubbli');

Pubbli.ShippingGrid = Ext.extend(Ext.grid.GridPanel, {
	initComponent : function() {

		this.shippingStore = new Ext.data.Store({
					autoLoad : true,
					url : 'http://www.pubblicommerce.com/action_shipping.php?reading=1&listing_id=' + this.oListingId,
					reader : new Ext.data.XmlReader({
								record : 'shipping',
								id : 'shipping_reader',
								idProperty : 'id'
							}, ['id', 'courier_name', 'days_to_delivery', 'charge'])
		});

		var config = {
			title : 'Shipping',
			frame : true,
			forceFit : true,
			store : this.shippingStore,
			columns : [{
						header : "Shipping Id",
						width : 100,
						dataIndex : 'id',
						sortable : true
					}, {
						header : "Courier Provider",
						width : 100,
						dataIndex : 'courier_name',
						sortable : true
					},  {
						header : "Days to Delivery",
						width : 100,
						dataIndex : 'days_to_delivery',
						sortable : true						
					},  {
						header : "Charges",
						width : 100,
						dataIndex : 'charge',
						sortable : true
					}],
			width : 540,
			height : 200
		};

		Ext.apply(this, Ext.apply(this.initialConfig,
						config));
						
		Pubbli.ShippingGrid.superclass.initComponent.apply(
				this, arguments);
	}
});

