Ext.onReady(function(){

    Ext.QuickTips.init();
    
    var xg = Ext.grid;

    // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       {name: 'Business Sector'},
       {name: 'Search Term (s)'},
       {name: 'Position on Google'},
       {name: 'Time Taken'},
       {name: 'desc'}
    ]);

    var grid = new xg.GridPanel({
        store: new Ext.data.GroupingStore({
            reader: reader,
            data: xg.dummyData,
            sortInfo:{field: 'Business Sector', direction: "ASC"},
            groupField:'Business Sector'
        }),

        columns: [
            {id:'Business Sector'
	    ,header: "Business Sector", width: 40, sortable: true, dataIndex: 'Business Sector'},
            {header: "Search Term (s)", width: 50, sortable: true, dataIndex: 'Search Term (s)'},
            {header: "Position on Google", width: 20, sortable: true, dataIndex: 'Position on Google'},
            {header: "Time Taken", width: 20, sortable: true, dataIndex: 'Time Taken'}

        ],

        view: new Ext.grid.GroupingView({
            forceFit:true,
            groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Keywords" : "Keyword"]})'
        }),

        frame:true,
        width: 670,
        height: 542,
        collapsible: true,
        animCollapse: false,
        title: 'Our Clients SEO Results',
        iconCls: 'icon-grid',
        renderTo: 'seo_main_fullpage_text'
    });
});



// Array data for the grids
Ext.grid.dummyData = [

[' Online Wedding Shop / Retail ',		' wedding accessories ',			5,	' 4 months '],
[' Online Wedding Shop / Retail ',		' table gems ',						5,	' 4 months '],
[' Online Wedding Shop / Retail ',		' wedding decorations ',			8,	' 2 months '],

[' Online Pet Store / Retail ',		' dog food ',			14,	' 1 month'],

[' Online Outdoor Store / Retail ',		' funky tents ',			10,	' 1 month'],
[' Online Outdoor Store / Retail ',		' rubber duck wellies ',			3,	' 1 month'],
[' Online Outdoor Store / Retail ',		' ladybird raincoat ',			3,	' 1 month'],

['Electrical Retail',		'hotpoint norwich',					1,	'2 months'],
['Electrical Retail',		'sn550sidlwh',						6,	'2 months'],
['Electrical Retail',		'electrical store norwich',			4,	'2 months'],

['Aviation Engineering',	'hilifts',							1,	'5 months'],
['Aviation Engineering',	'ground support equipment',5,	'3 months'],
['Aviation Engineering',	'ambulance lifts',					5,	'3 months'],

['Financial Services',		'ethical ifa',			9,	'3 weeks'],

[' Cleaning Products ',		' norovirus treatment ',						8,	' 2 months '],
[' Cleaning Products ',		' antibacterial cleaner ',						6,	' 2 months '],
[' Cleaning Products ',		' kitchen spray ',						22,	' 2 months '],



['Marine Upholstery',		'marine upholsterer norfolk',		1,	'2 months'],

['Landscape Gardeners',		'garden creations',					4,	'2 months'],
['Landscape Gardeners',		'design me a garden',			1,	'6 weeks'],


['Drain Services',		'drain service',				5,	'3 months'],
['Drain Services',		'blocked drains norfolk',				7,	'1 month'],
['Drain Services',		'drain blockage service',				7,	'1 month'],

[' Equity Release  ',		' equity release adviser ',						4,	' 2 months '],
[' Equity Release  ',		' equity release community ',	1 & 2,	        ' 2 months '],
[' Equity Release  ',		' equity release lenders ',						1,	' 2 months '],
[' Equity Release  ',		' equity release adviser merseyside ',	5 & 6,	        ' 2 months '],
[' Equity Release Advice ',		' freeing equity in my house ',				1,	' 2 months '],

[' Photocopier and IT Services ',		' panasonic copiers ',						25,	' 5 weeks '],
[' Photocopier and IT Services ',		' panasonic norfolk ',					1,	' 5 weeks '],
[' Photocopier and IT Services ',		' it cabling services norwich ',			4,	' 5 weeks '],

[' Plastic Bottle Manufacturers  ',		' oval hdpe bottle ',						10,	' 2 months '],
[' Plastic Bottle Manufacturers  ',		' hdpe bottle manufacturer ',				3,' 2 months '],

[' Boiler Manufacturers ',		' oil fired boilers ',					4,	' 3 months '],
[' Boiler Manufacturers ',		' oil boilers ',						10,	' 3 months '],

[' Oil Pipeline Parts Manufacturer ',		' hastelloy pipe ',						3,			' 2 months '],
[' Oil Pipeline Parts Manufacturer ',		' titanium fittings ',			5,	' 2 months '],
[' Oil Pipeline Parts Manufacturer ',		' socket weld fittings ',	10,	' 2 months '],


[' Equity Release Advice ',		' equity release solicitor kent  ',			6,	' 2 months '],
[' Equity Release Advice ',		' equity release adviser manchester  ',		7,	' 2 months '],
[' Equity Release Advice ',		' equity release provider cardiff  ',		5,	' 2 months '],


[' Special Needs School ',		' adhd club  ',						7,	' 1 month '],



[' Executive Inflight Catering ',		' vip airline catering ',						1 & 2,	' 2 months '],
[' Executive Inflight Catering ',		' executive aircraft catering ',					4,	' 2 months '],
[' Executive Inflight Catering ',		' airline food ',					10,	' 2 months '],


[' Events/Experiences ',		' flair events ',					3,	' 2 months '],
[' Events/Experiences ',		' event management norwich ',					4,	' 2 months '],


[' Garden Designer ',		' modern garden planters ',					7,	' 4 months '],


[' Beauty Treatment -Retail  ',		' beauty salon newport pagnell  ',	1,	' 2 months '],
[' Beauty Treatment -Retail  ',		' beauty salon buckinhamshire  ',	1,	' 2 months '],

[' Travel  ',		' honeymoon butler  ',	8,	' 1 month '],
[' Travel  ',		' honeymoon butler  ',	8,	' 1 month '],


[' Car Body Repairs ',		' vehicle repair norwich ',					8,	' 3 months '],
[' Car Body Repairs ',		' vehicle paint specialists norfolk ',		3,	' 2 months '],
[' Car Body Repairs ',		' accident damage repair norfolk ',			5,	' 3 months '],

[' Lorry Parts ',		' truck parts ',							8,	' 3 months '],


[' PVC Door Manufacturer  ',		' hyaline fast doors ',				1,	' 4 weeks '],

[' Cleaning Tissues ',		' disposable tissues ',						2,	' 3 months ']



//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
					
						
			


];




/*
Ext.onReady(function() {

Ext.QuickTips.init();

	var myData = [
		['Electrical Retail','hotpoint norwich',1,'2 months'],
		['Electrical Retail','sn550sidlwh',6,'2 months'],
		['Electrical Retail','electrical store norwich',4,'2 months'],
		['Aviation Engineering','aviation ground support equipment',6,'1 Year'],
		['Aviation Engineering','hilifts',1,'1 Year'],
		['Aviation Engineering','hilifts',1,'1 Year']
	];
 
	var myReader = new Ext.data.ArrayReader({}, [
		{name: 'Business Sector'},
		{name: 'Search Term (s)'},
		{name: 'Position on Google'},
		{name: 'Time Taken'}
	]);
 
	var grid = new Ext.grid.GridPanel({
		store: new Ext.data.Store({
			data: myData,
			reader: myReader,
			autoSizeColumns: true,
			autoSizeHeaders: false,
			trackMouseOver: true,

		}),
		columns: [
			{header: 'Business Sector', width: 120, sortable: true, dataIndex: 'Business Sector'},
			{header: 'Search Term (s)', width: 190, sortable: true, dataIndex: 'Search Term (s)'},
			{header: 'Position on Google', width: 120, sortable: true, dataIndex: 'Position on Google'},
			{header: 'Time Taken', width: 120, sortable: true, dataIndex: 'Time Taken'},
		],
		viewConfig: {
			forceFit: true
		},
		renderTo: 'content',
		title: 'Metalfrog',
autoScroll : true,

width: 600,
        height:300,
        minWidth: 300,
        minHeight: 200,
        layout: 'fit',
        plain:true





	
		
	});
 
	grid.getSelectionModel().selectFirstRow();
	
});
*/
