/*

 * Ext JS Library 2.1

 * Copyright(c) 2006-2008, Ext JS, LLC.

 * licensing@extjs.com

 * 

 * http://extjs.com/license

             url: 'http://201.134.16.232/pru/proyoperadores/administrador/getallpreguntas2.asp?dominio=1'

			 url: 'http://www.asesorinteligente.com/extjs/datos4.xml'





 */



Ext.onReady(function(){



    // create the Data Store

    var store = new Ext.data.Store({

        // load using HTTP

        

        url: 'http://www.asesorinteligente.com/admin/getallpreguntas.asp?dominio=1',



        // the return will be XML, so lets set up a reader

        reader: new Ext.data.XmlReader({

               // records will have an "Item" tag

               record: 'Item',

               id: 'IdPregunta',

               totalRecords: '@total'

           }, [

               // set up the fields mapping into the xml doc

               // The first needs mapping, the others are very basic

               'IdPregunta',

               'Pregunta', 'Respuesta', 'Claves'

           ])

    });



    // create the grid

    var grid = new Ext.grid.GridPanel({

        store: store,

        columns: [

            {header: "Id", width: 30, dataIndex: 'IdPregunta', sortable: true},

            {header: "Pregunta", width: 280, dataIndex: 'Pregunta', sortable: true},

            {header: "Respuesta", width: 220, dataIndex: 'Respuesta', sortable: true},

            {header: "Claves", width: 200, dataIndex: 'Claves', sortable: true}

        ],

        renderTo:'example-grid',

        width:735,

        height:200

    });



    store.load();

});

