1. #1
    Ext User
    Join Date
    Mar 2008
    Posts
    3
    Vote Rating
    0
    appleSeb is on a distinguished road

      0  

    Question New user pb - Ghost values in a grig

    New user pb - Ghost values in a grig


    Hi, I make a prototype with EXT and I have some pb with GRID values.
    ext1.jpg
    Associated code:
    PHP Code:
     [html]    SampleGrid.superclass.constructor.call(this, {
            store: new Ext.data.Store({
                reader: new Ext.data.ArrayReader({}, [
                       {name: 'op'},
                       {name: 'w'},
                       {name: 'pw'},
                       {name: 'm'},
                       {name: 'pm'},
                       {name: 't'},
                       {name: 'pt'},
                       {name: 'a'},
                       {name: 'pa'}
                       
                  ]),
                <?php
                
    //print_r($percentT);
    //print_r($valT);
                
    echo 'data:[';
                for (
    $index 0$index <= $b$index++)
                    { 
                      if (
    $index $b)
                      {echo 
    '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index].','.$valM[$index].','.$percentT[$index].','.$valY[$index].','.$percentY[$index].'],';}
                      else
                      {echo 
    '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index].','.$valM[$index].','.$percentT[$index].','.$valY[$index].','.$percentY[$index].']';}
                                        }
                      echo 
    ']';
                
    ?>
            }),
            columns: columns,
            autoExpandColumn: 'op',
            width:400
        });[/html]
    Columns beetween "Trim" are wrong. The value for "Trim" are in "% Trim".

    If I suppress the "Trim" values form the echo line, like following :
    PHP Code:
                <?php
                
    //print_r($percentT);
    //print_r($valT);
                
    echo 'data:[';
                for (
    $index 0$index <= $b$index++)
                    { 
                      if (
    $index $b)
                      {echo 
    '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index]./*','.$valT[$index].*/','.$percentT[$index].','.$valY[$index].','.$percentY[$index].'],';}
                      else
                      {echo 
    '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index]./*','.$valT[$index].*/','.$percentT[$index].','.$valY[$index].','.$percentY[$index].']';}
                                        }
                      echo 
    ']';
                
    ?>
    We can see the result here :
    ext2.jpg
    Values for "% Trim", "Annee", "% annee" are good.
    Only the "Trim" column id wrong, and I don't know where the values comming.

    Anybody's have an idea

    Thanks for response

    Seb

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    what does your actual data look like?

  3. #3
    Ext User
    Join Date
    Mar 2008
    Posts
    3
    Vote Rating
    0
    appleSeb is on a distinguished road

      0  

    Default


    Datas came from queries like that :
    PHP Code:
    for ($iii =0$iii <= $b$iii++)
                            {
    $name "SELECT * FROM " $table " WHERE comID = " $idx " and action = ".$tabID[$iii]." and sem=" $w" and annee=" $annee;
    $result mysql_query($name$gunnebo) or die(mysql_error());
    $totalRows_rsca mysql_num_rows($result);
    $var $totalRows_rsca/$totalRows_totalaction*100;
    $var number_format($var0','' ');
    $t $t $totalRows_rsca;
    array_push($val$totalRows_rsca);
    array_push($percent$var);
                } 
    The var column definition id the following:
    var columns = [
    {id:'op',header: "Resultat par critere", width: 45, sortable: true, renderer: objectif, dataIndex: 'op'},
    {header: "Semaine", width: 50, sortable: false, renderer: objectif, dataIndex: 'w'},
    {header: "% Sem.", width: 45, sortable: false, renderer: pctobjectif, dataIndex: 'pw'},
    {header: "Mois", width: 75, sortable: false, renderer: objectif, dataIndex: 'm'},
    {header: "% Mois", width: 65, sortable: false, renderer: pctobjectif, dataIndex: 'pm'},
    {header: "T", width: 75, sortable: false, renderer: objectif, dataIndex: 't'},
    {header: "% Trim", width: 45, sortable: false, renderer: pctobjectif, dataIndex: 'pt'},
    {header: "Annee", width: 45, sortable: false, renderer: objectif, dataIndex: 'a'},
    {header: "% An.", width: 45, sortable: false, renderer: pctobjectif, dataIndex: 'pa'}
    ];
    When I edit the code of the generated page we can see data's :

    Code:
    SampleGrid.superclass.constructor.call(this, {
            store: new Ext.data.Store({
                reader: new Ext.data.ArrayReader({}, [
                       {name: 'op'},
                       {name: 'w'},
                       {name: 'pw'},
                       {name: 'm'},
                       {name: 'pm'},
                       {name: 't'},
                       {name: 'pt'},
                       {name: 'a'},
                       {name: 'pa'}
                       
                  ]),
    data:[['Obtention Commande',1,2,3,5,3,3,5,23,21,9],
    ['Demande Devis',1,2,3,5,3,3,5,9,8,6],
    ['Formation Vendeurs',1,2,2,3,5,2,4,4,3,8],
    ['Equipement Show-room',1,2,3,5,3,3,5,6,5,7],
    ['Suivi devis Distributeur',1,2,2,3,5,2,4,5,4,8],
    ['Organisation evennement',1,2,2,3,5,2,4,5,4,8],
    ['Habillage PLV',0,0,2,3,5,2,4,2,1,9],
    ['Accompagnement Vendeur',1,2,2,3,5,2,4,2,1,9],
    ['BIlan Client',1,2,1,1,8,1,2,2,1,9],
    ['Referencement',1,2,1,1,8,1,2,1,1,0],
    ['Presentation gamme',9,21,11,19,3,11,19,13,12,4],
    ['Simple Visite',23,55,24,42,1,24,42,32,30,5],
    ['Mailing local',1,2,1,1,8,1,2,1,1,0]]        }),
            columns: columns,
            autoExpandColumn: 'op',
            width:400
        });
    Numbers of data in each line : 11

    The command corresponding to the generation can generate : only 9 data's per line
    <?php
    //print_r($valT);
    //print_r($percentT);

    echo 'data:[';
    for ($index = 0; $index <= $b; $index++)
    {
    if ($index < $b)
    {echo '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index].','.$valT[$index].','.$percentT[$index].','.$valY[$index].','.$percentY[$index].'],';}
    else
    {echo '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index].','.$valT[$index].','.$percentT[$index].','.$valY[$index].','.$percentY[$index].']';}
    }
    echo ']';
    ?>

  4. #4
    Ext User
    Join Date
    Mar 2008
    Posts
    3
    Vote Rating
    0
    appleSeb is on a distinguished road

      0  

    Default


    Quote Originally Posted by appleSeb View Post
    Datas came from queries like that :
    PHP Code:
    for ($iii =0$iii <= $b$iii++)
                            {
    $name "SELECT * FROM " $table " WHERE comID = " $idx " and action = ".$tabID[$iii]." and sem=" $w" and annee=" $annee;
    $result mysql_query($name$gunnebo) or die(mysql_error());
    $totalRows_rsca mysql_num_rows($result);
    $var $totalRows_rsca/$totalRows_totalaction*100;
    $var number_format($var0','' ');
    $t $t $totalRows_rsca;
    array_push($val$totalRows_rsca);
    array_push($percent$var);
                } 
    The var column definition id the following:
    var columns = [
    {id:'op',header: "Resultat par critere", width: 45, sortable: true, renderer: objectif, dataIndex: 'op'},
    {header: "Semaine", width: 50, sortable: false, renderer: objectif, dataIndex: 'w'},
    {header: "% Sem.", width: 45, sortable: false, renderer: pctobjectif, dataIndex: 'pw'},
    {header: "Mois", width: 75, sortable: false, renderer: objectif, dataIndex: 'm'},
    {header: "% Mois", width: 65, sortable: false, renderer: pctobjectif, dataIndex: 'pm'},
    {header: "T", width: 75, sortable: false, renderer: objectif, dataIndex: 't'},
    {header: "% Trim", width: 45, sortable: false, renderer: pctobjectif, dataIndex: 'pt'},
    {header: "Annee", width: 45, sortable: false, renderer: objectif, dataIndex: 'a'},
    {header: "% An.", width: 45, sortable: false, renderer: pctobjectif, dataIndex: 'pa'}
    ];
    When I edit the code of the generated page we can see data's :

    Code:
    SampleGrid.superclass.constructor.call(this, {
            store: new Ext.data.Store({
                reader: new Ext.data.ArrayReader({}, [
                       {name: 'op'},
                       {name: 'w'},
                       {name: 'pw'},
                       {name: 'm'},
                       {name: 'pm'},
                       {name: 't'},
                       {name: 'pt'},
                       {name: 'a'},
                       {name: 'pa'}
                       
                  ]),
    data:[['Obtention Commande',1,2,3,5,3,3,5,23,21,9],
    ['Demande Devis',1,2,3,5,3,3,5,9,8,6],
    ['Formation Vendeurs',1,2,2,3,5,2,4,4,3,8],
    ['Equipement Show-room',1,2,3,5,3,3,5,6,5,7],
    ['Suivi devis Distributeur',1,2,2,3,5,2,4,5,4,8],
    ['Organisation evennement',1,2,2,3,5,2,4,5,4,8],
    ['Habillage PLV',0,0,2,3,5,2,4,2,1,9],
    ['Accompagnement Vendeur',1,2,2,3,5,2,4,2,1,9],
    ['BIlan Client',1,2,1,1,8,1,2,2,1,9],
    ['Referencement',1,2,1,1,8,1,2,1,1,0],
    ['Presentation gamme',9,21,11,19,3,11,19,13,12,4],
    ['Simple Visite',23,55,24,42,1,24,42,32,30,5],
    ['Mailing local',1,2,1,1,8,1,2,1,1,0]]        }),
            columns: columns,
            autoExpandColumn: 'op',
            width:400
        });
    Numbers of data in each line : 11

    The command corresponding to the generation can generate : only 9 data's per line
    <?php
    //print_r($valT);
    //print_r($percentT);

    echo 'data:[';
    for ($index = 0; $index <= $b; $index++)
    {
    if ($index < $b)
    {echo '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index].','.$valT[$index].','.$percentT[$index].','.$valY[$index].','.$percentY[$index].'],';}
    else
    {echo '[\''.$tab[$index].'\','.$val[$index].','.$percent[$index].','.$valM[$index].','.$percentM[$index].','.$valT[$index].','.$percentT[$index].','.$valY[$index].','.$percentY[$index].']';}
    }
    echo ']';
    ?>
    Anybody's have an idea

    Thanks for response

    Seb

Thread Participants: 1