5 Replies Latest reply on May 29, 2010 5:59 PM by miguel8312

    how to align list data in flex datagrid HELP?!!!

    miguel8312 Level 3

      Guys this should seem simple to do but im having a mental block or I'm just plain ol stupid.

      I get a list from a webservice like this

      1

      1

      1

      1

      1

      but when i would like to display the data in datagrid

      like this

      1 1

      1 1

      1 1

      1 1

      I tried building a function like this but i get empty rows. On one of the column of the grid. Im sure there has got to be a way of doing this.

       

      public function Validate(event:ResultEvent):void{

       

       

       

       

      // list.dataProvider = event.result;

       

       

      var count:Number = new Number;

       

      for each(var item:Object in event.result as ArrayCollection)

                {

                     count++;

       

      if (count%2==0)

       

                {dataP.addItem({

      "fwvitals_message":item.fwvitals_message})}

       

      else

                {

                dataP.addItem({

      "fwvitals_message2":item.fwvitals_message})

       

                }

       

                }    

       

                list.dataProvider = dataP;

       

       

       

       

       

       

       

                }

       

       

       

      // list.dataProvider = event.result;

       

       

      var count:Number = new Number;

       

      for each(var item:Object in event.result as ArrayCollection)

                {

                     count++;

       

      if (count%2==0)

       

                {dataP.addItem({

      "fwvitals_message":item.fwvitals_message})}

       

      else

                {

                dataP.addItem({

      "fwvitals_message2":item.fwvitals_message})

       

                }

       

                }    

       

                list.dataProvider = dataP;

       

       

       

       

       

       

       

                }

       

       

       

       

       

       

       

      any help would be greatly appreciated.

      Miguel