/*!
 * Ext JS Library 3.2.0
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.onReady(function(){

    // NOTE: This is an example showing simple state management. During development,
    // it is generally best to disable state management as dynamically-generated ids
    // can change across page loads, leading to unpredictable results.  The developer
    // should ensure that stable state ids are set for stateful components in real apps.    
   

    var store = new Ext.data.JsonStore({
        url: 'latestNews.php',
        root: 'news',
        fields: ['title', 'date']
    });
    store.load();


    // create the Grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        stripeRows: true,
        title: 'Άρθρα - Επικαιρότητα - Blog',
        renderTo: 'grid-example',
        columns: [
            {id:'title', header:'<b>ΘΕΜΑ</b>', width: 500, sortable: true, dataIndex: 'title'},
            {id:'date', header:'Ημερομηνία', width: 100, sortable: true, dataIndex: 'date'}
        ],
        autoHeight: true, 
        width: 600      
    });
     
    // render the grid to the specified div in the page
    
});
