/*
 * Ext JS Library 2.0.1
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */
 
StopGrid = function(){

    StopGrid.superclass.constructor.call(this, {
        store: new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'mph', type: 'float'},
                   {name: 'distance', type: 'float'}
              ]),
            data: [
                [30,44],
                [45,99],
                [60,163]
            ]
        }),
        columns: [
        {header: "MPH", width: 75, sortable: true,  dataIndex: 'mph'},
        {header: "Feet", width: 75, sortable: true,  dataIndex: 'distance'}
    ],
        height:120,
        width:600
    });
}

FuelGrid = function(){

    FuelGrid.superclass.constructor.call(this, {
        store: new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'description'},
                   {name: 'mpg', type: 'float'}
              ]),
            data: [
                ['Steady 30 mph',19.3],
                ['Steady 45 mph', 17.9],
                ['Steady 60 mph', 16.0],
				['Steady 75 mph', 14.2],
				['Sop-and-go driving', 11.6],
				['Tank Ave for 1148 miles', 13.3]
            ]
        }),
        columns: [
        {header: "Description", width: 180, sortable: true,  dataIndex: 'description'},
        {header: "MPG", width: 75, sortable: true,  dataIndex: 'mpg'}
    ],
        height:120,
        width:600
    });
}
ErrorGrid = function(){

    ErrorGrid.superclass.constructor.call(this, {
        store: new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'speedometer', type: 'float'},
                   {name: 'actual', type: 'float'}
              ]),
            data: [
                [33,30],
                [49,45],
                [65,60],
				[81,75],
				[999,116]
            ]
        }),
        columns: [
        {header: "Speedometer MPH", width: 120, sortable: true,  dataIndex: 'speedometer'},
        {header: "Actual MPH", width: 75, sortable: true,  dataIndex: 'actual'}
    ],
        height:120,
        width:600
    });
}

AccelerationGrid = function(){

    AccelerationGrid.superclass.constructor.call(this, {
        store: new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'description'},
                   {name: 'seconds', type: 'float'}
              ]),
            data: [
                ['Standing start 1/4 mile (78 mph)',17.5],
                ['0-30', 3.9],
                ['0-60', 9.8],
				['10-30', 3.0],
				['30-50', 4.4],
				['50-80', 11.7]
            ]
        }),
        columns: [
        {header: "Description", width: 180, sortable: true,  dataIndex: 'description'},
        {header: "Seconds", width: 75, sortable: true,  dataIndex: 'seconds'}
    ],
        height:120,
        width:600
    });
}

SpeedGrid = function(){

    SpeedGrid.superclass.constructor.call(this, {
        store: new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'description'},
                   {name: 'mph', type: 'float'}
              ]),
            data: [
                ['Fastest 1-way run',107.3],
                ['Slowest 1-way run', 105.5],
                ['Average of 4 runs', 106.5]
            ]
        }),
        columns: [
        {header: "Description", width: 110, sortable: true,  dataIndex: 'description'},
        {header: "MPH", width: 75, sortable: true,  dataIndex: 'mph'}
    ],
        height:120,
        width:600
    });
}

HPGrid = function(){


    HPGrid.superclass.constructor.call(this, {
        store: new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'hp', type: 'float'},
                   {name: 'rpm', type: 'float'},
                   {name: 'mph', type: 'float'}
              ]),
            data: [
                [67,1700,24],
                [84,2000,37],
                [93,2500,58],
                [110,3100,76]
            ]
        }),
        columns: [
        {header: "Road HP", width: 75, sortable: true,  dataIndex: 'hp'},
        {header: "RPM", width: 75, sortable: true,  dataIndex: 'rpm'},
        {header: "MPH", width: 75, sortable: true,  dataIndex: 'mph'}
    ],
        height:120,
        width:600
    });


}

SampleGrid = function(limitColumns){


    SampleGrid.superclass.constructor.call(this, {
        store: new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'hp', type: 'float'},
                   {name: 'rpm', type: 'float'},
                   {name: 'mph', type: 'float'}
              ]),
            data: [
                [67,1700,24],
                [84,2000,37],
                [93,2500,58],
                [110,3100,76]
            ]
        }),
        columns: [
        {header: "Road HP", width: 75, sortable: true,  dataIndex: 'hp'},
        {header: "RPM", width: 75, sortable: true,  dataIndex: 'rpm'},
        {header: "MPH", width: 75, sortable: true,  dataIndex: 'mph'}
    ],
        height:120,
        width:600
    });


}

Ext.extend(StopGrid, Ext.grid.GridPanel);
Ext.extend(FuelGrid, Ext.grid.GridPanel);
Ext.extend(ErrorGrid, Ext.grid.GridPanel);
Ext.extend(AccelerationGrid, Ext.grid.GridPanel);
Ext.extend(SpeedGrid, Ext.grid.GridPanel);
Ext.extend(HPGrid, Ext.grid.GridPanel);
Ext.extend(SampleGrid, Ext.grid.GridPanel);