/*
 * Ext JS Library 2.0
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */


Ext.onReady(function(){

    Ext.QuickTips.init();
    
    var xg = Ext.grid;

    // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       {name: 'company'},
       {name: 'price', type: 'float'},
       {name: 'price1', type: 'float'},
       {name: 'price2', type: 'float'},
       {name: 'price3', type: 'float'},
	   {name: 'price4', type: 'float'},
       {name: 'desc'}
    ]);

    // row expander
    var expander = new xg.RowExpander({
        tpl : new Ext.Template(
            '<p><b>KenTV Pricetracker:</b> {company}<br>',
            '<p><b>Summary:</b> {desc}</p>'
        )
    });

    



    var sm = new xg.CheckboxSelectionModel();
   



    
    var sm2 = new xg.CheckboxSelectionModel();
    var grid4 = new xg.Grid3({
        id:'button-grid',
        ds: new Ext.data.Store({
            reader: reader,
            data: xg.dummyData
        }),
        cm: new xg.ColumnModel([
            sm,
            {id:'ITEM ',header: "ITEM", width: 40, sortable: true, dataIndex: 'company'},
            {header: "Nakumatt", width: 20, sortable: true, renderer: Ext.util.Format.ukMoney, dataIndex: 'price'},
            {header: "Uchumi", width: 20, sortable: true, dataIndex: 'price1'},
            {header: "Tuskys", width: 20, sortable: true, dataIndex: 'price2'},
			{header: "Woolmatt", width: 20, sortable: true, dataIndex: 'price3'},
            {header: "Chandaria", width: 20, sortable: true, dataIndex: 'price4'}
        ]),
        sm: sm2,

        viewConfig: {
            forceFit:true
        },

        // inline buttons
        

        // inline toolbars
        

        cls:'x-panel-blue',
        width:950,
        height:450,
        frame:true,
        title:'KenTV Price Comparisson:: IN THE KITCHEN',
        iconCls:'icon-grid',
        renderTo: document.body
    });
});



// Array data for the grids
Ext.grid.dummyData = [
    ['2Kgs Pembe Maize meal',86,86,85,85,90],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2kgs Golden Fry Cooking oil',206,207,206,205,207],
    ['2Kgs Mwea Pishori rice',115,110,109,110,112],
    ['2Kgs Mwea Pishori rice',266,255,268,255,275],
	['1Kg Blue Band Margarine',215,220,220,220,215],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
	['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
	['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112]
	
	
];




Ext.onReady(function(){

    Ext.QuickTips.init();
    
    var xg = Ext.grid;

    // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       {name: 'company'},
       {name: 'price', type: 'float'},
       {name: 'price1', type: 'float'},
       {name: 'price2', type: 'float'},
       {name: 'price3', type: 'float'},
	   {name: 'price4', type: 'float'},
       {name: 'desc'}
    ]);

    // row expander
    var expander = new xg.RowExpander({
        tpl : new Ext.Template(
            '<p><b>KenTV Pricetracker:</b> {company}<br>',
            '<p><b>Summary:</b> {desc}</p>'
        )
    });

    



    var sm = new xg.CheckboxSelectionModel();
   



    
    var sm2 = new xg.CheckboxSelectionModel();
    var grid4 = new xg.Grid3({
        id:'button-grid',
        ds: new Ext.data.Store({
            reader: reader,
            data: xg.dummyData
        }),
        cm: new xg.ColumnModel([
            sm,
            {id:'ITEM ',header: "ITEM", width: 40, sortable: true, dataIndex: 'company'},
            {header: "Nakumatt", width: 20, sortable: true, renderer: Ext.util.Format.ukMoney, dataIndex: 'price'},
            {header: "Uchumi", width: 20, sortable: true, dataIndex: 'price1'},
            {header: "Tuskys", width: 20, sortable: true, dataIndex: 'price2'},
			{header: "Woolmatt", width: 20, sortable: true, dataIndex: 'price3'},
            {header: "Chandaria", width: 20, sortable: true, dataIndex: 'price4'}
        ]),
        sm: sm2,

        viewConfig: {
            forceFit:true
        },

        // inline buttons
        

        // inline toolbars
        

        cls:'x-panel-blue',
        width:950,
        height:450,
        frame:true,
        title:'KenTV Price Comparisson:: MEAT MARKET',
        iconCls:'icon-grid',
        renderTo: document.body
    });
});



// Array data for the grids
Ext.grid.dummyData = [
    ['Farmers Choice 500g minced beef',225,215,213,215,179],
    ['Farmers Choice Collar Bacon 100gm',111,110,110,100,110],
    ['2kgs Golden Fry Cooking oil',206,207,206,205,207],
    ['2Kgs Mwea Pishori rice',115,110,109,110,112],
    ['2Kgs Mwea Pishori rice',266,255,268,255,275],
	['1Kg Blue Band Margarine',215,220,220,220,215],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
	['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
	['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112],
    ['2Kgs Pembe Wheat flour',115,110,109,110,112]
	
	
];

// add in some dummy descriptions
for(var i = 0; i < Ext.grid.dummyData.length; i++){
    Ext.grid.dummyData[i].push('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br/><br/>Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit.');
}