/*!
 * Ext JS Library 3.0+
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.onReady(function(){

    // create the Data Store
    var store = new Ext.data.Store({
        // load using HTTP
        url: '_XML.php?target=http://www.pfgbest.com/common/ibs/margins.xml',

        // the return will be XML, so lets set up a reader
        reader: new Ext.data.XmlReader({
               // records will have an "Item" tag
               record: 'item',
               totalRecords: '@total'
           }, [
               // set up the fields mapping into the xml doc
               // The first needs mapping, the others are very basic
               {name: 'market', mapping: 'market'},
               'initial', 'maintenance'
           ])
    });

    // create the grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        columns: [
            {header: "Market", width: 370, dataIndex: 'market', sortable: true},
            {header: "Initial", width: 186, dataIndex: 'initial', sortable: true},
            {header: "Maintenance", width: 224, dataIndex: 'maintenance', sortable: true}
        ],
        renderTo:'data-grid',
		enableColumnHide : false,
		enableColumnMove : false,
		enableHdMenu : false,
		stripeRows : true,
		trackMouseOver : false,
        width:805,
        height:425
    });

    store.load();
});

