/*!
 * 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=iso-currency-codes.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: 'name', mapping: 'name'},
               'currency', 'alphabetic', 'numeric'
           ])
    });

    // create the grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        columns: [
            {header: "Entity", width: 280, dataIndex: 'name', sortable: true},
            {header: "Currency", width: 244, dataIndex: 'currency', sortable: true},
            {header: "Alphabetic", width: 130, dataIndex: 'alphabetic', sortable: true},
            {header: "Numeric", width: 106, dataIndex: 'numeric', sortable: true}
        ],
        renderTo:'data-grid',
		enableColumnHide : false,
		enableColumnMove : false,
		enableHdMenu : false,
		stripeRows : true,
		trackMouseOver : false,
        maxWidth:805,
        height:300
    });

    store.load();
});

