5 Replies Latest reply on Jun 13, 2010 4:44 AM by anxious33

    How to modify data recieved from the database and displayed in a DG

    anxious33

      Hello, it's me again with a simple question :

       

      i've got the SQLi request who returns multiples rows.

       

      In this row i have for example :

       

      Reward --> 1

       

       

      How to, instead of displaying  1 in the datagrid, change this value to "YES"

       

      I follow this lead :

       

      private function onResultStats(event:ResultEvent):void

                  {

                      ServerStatsArr = new ArrayCollection(event.result.source);

                      for (var i:int=0; i < ServerStatsArr.length;i++)

                      {

                          if (ServerStatsArr[i].abonnement ==  304){

                              ServerStatsArr[i].abonnement = 'Premium';

                          }else{

                              ServerStatsArr[i].abonnement = 'Non';   

                          }

                          if (ServerStatsArr[i].transparence ==  1) {

                              ServerStatsArr[i].transparence = 'Oui' ;

                          }else{

                              ServerStatsArr[i].transparence = 'Non' ;

                          }

                      }

                      ServerStatsArr.refresh();

                  }

       

      Why this method is working for abonnement when (ServerStatsArr[i].abonnement ==  304) it displays Premium but it's NOT working for transparence ?

       

      i tested (ServerStatsArr[i].transparence ==  1) and (ServerStatsArr[i].transparence ==  '1')

       

      Thank you