Hi,

I send parameters to php to open and scroll through a text file so that the content of each line read in php is converted to Json format and my grip panel is filled. So far I get the content in json format, but I can not get my grid panel filled. I will appreciate the help or clues that you can give me to get what I need.

My Js Code:
Code:
Ext.onReady(function() {

    // var for test (This will be dynamic)
    var Country_Progr = '* Costa Rica 2011';

            // My data model
            Ext.define('MyGrid_SPC', {
            extend:'Ext.data.Model',
            fields: [
                {name: Country_Progr, type: 'string'}
            ],
        });

    // var for test (This will be dynamic)
    var ProgrForRead = 'CostaRica2011Test.SPC';

    // My data store
    var store_SPC = Ext.create('Ext.data.JsonStore',{
            storeId: 'store_SPC',
            model: 'MyGrid_SPC',
            autoLoad: true,
            proxy: {
                        type: 'ajax', // La llamada Ajax
                         url:  'get-Progrfiles.php?FileImput='+ProgrForRead+'&raiz=' +  Country_Progr,// Invoca y pasa parámetros al archivo php
                        root: 'Sebas',
                            reader:{
                                type:'json',
                                root: 'Sebas'
                            }

                    },


        });

    var GridView_SPC = Ext.create('Ext.grid.Panel', {
            store : store_SPC,
            id: 'store_SPC',
            height: '100%',
            border: 0,
            loadMask: true,
            cls: 'custom',
            multiselect: true,
            columns:[

                    {
                        header: 'TextoProgr',
                        dataIndex: Country_Progr,
                        flex: 1,
                    },

            ]
        });


});
My php:
PHP Code:
<?php

$porabrir 
= isset($_REQUEST['FileImput'])?$_REQUEST['FileImput']:"";
$otro = isset($_REQUEST['raiz'])?$_REQUEST['raiz']:"";

$block =1024*1024;//1MB or counld be any higher than HDD block_size*2

if( $fh fopen($porabrir"r") ){ 

    
$left='';

    while (!
feof($fh)) {// read the file

       
$temp fread($fh$block);

       
$fgetslines explode("\n",$temp);


       
$fgetslines[0]=$left.$fgetslines[0];
       if(!
feof($fh) )$left array_pop($lines);
 
       foreach(
$fgetslines as $k => $line){
           

               
$final explode("\r",$line);

               
$sebas $final[0];

            
$aljson explode(".",$porabrir);

            
$ParaFinal "{".'"'.$otro.'"'.":".'"'.$sebas.'"'."},"."\n";

            
$Entrega explode("\n",$ParaFinal);

                
//echo ($ParaFinal);
        
}

        echo 
"]}";
     }
}

fclose($fh);

?>
Content in "'CostaRica2011Test.SPC" (for open and read in php)
Code:
* Costa Rica 2011
RUNDEF PA4T
   SELECTION ALL
   UNIVERSE POBLACIO.NACIMIEN = 3

* SELECCION DE PAISES RELEVANTES (Paises de LA y El Caribe + aquellos 
* con presencia >= a 500 nacidos en el extranjero
DEFINE POBLACIO.PAISNACI
  AS RECODE  POBLACIO.LUGNACEX
  (32  = 1)
  (68  = 2)
  (76  = 3)
  (152 = 4)
ELSE 42
 TYPE INTEGER
 RANGE 1-42
 VALUELABELS
1 "Argentina                           "
2 "Bolivia (Estado Plurinacional de)   "
3 "Brasil                              "
4 "Chile                               "
My result in Json Format
Code:
{"Sebas":

[
{"* Costa Rica 2011":"* Costa Rica 2011"},
{"* Costa Rica 2011":"RUNDEF PA4T"},
{"* Costa Rica 2011":"   SELECTION ALL"},
{"* Costa Rica 2011":"   UNIVERSE POBLACIO.NACIMIEN = 3"},
{"* Costa Rica 2011":""},
{"* Costa Rica 2011":"* SELECCION DE PAISES RELEVANTES (Paises de LA y El Caribe + aquellos "},
{"* Costa Rica 2011":"* con presencia >= a 500 nacidos en el extranjero"},
{"* Costa Rica 2011":"DEFINE POBLACIO.PAISNACI"},
{"* Costa Rica 2011":"  AS RECODE  POBLACIO.LUGNACEX"},
{"* Costa Rica 2011":"  (32  = 1)"},
{"* Costa Rica 2011":"  (68  = 2)"},
{"* Costa Rica 2011":"  (76  = 3)"},
{"* Costa Rica 2011":"  (152 = 4)"},
{"* Costa Rica 2011":"ELSE 42"},
{"* Costa Rica 2011":" TYPE INTEGER"},
{"* Costa Rica 2011":" RANGE 1-42"},
{"* Costa Rica 2011":" VALUELABELS"},
{"* Costa Rica 2011":"1 "Argentina                           ""},
{"* Costa Rica 2011":"2 "Bolivia (Estado Plurinacional de)   ""},
{"* Costa Rica 2011":"3 "Brasil                              ""},
{"* Costa Rica 2011":"4 "Chile                               ""}

}]