0 Replies Latest reply on Oct 15, 2011 1:54 PM by clb2196@gmail.com

    Multi-dimensional array for data provider

    clb2196@gmail.com

      Hey guys-

       

      What I'm trying to do is create a multi dimensional array to be the data prodiver for my data grid. Here's a simlified version of what I'm trying to do:

       

      [Bindable]

      protected var dp2:ArrayCollection = new ArrayCollection;

       

      for(var i:Number = 0; i<dp.length; i++){

       

                          mydata = [];

                          mydata.push( { Title: "mytitlehere", Summary: "mysummaryhere" } );

                          dp2.addItem(mydata);

      }

       

       

      <mx:DataGrid id="actorGrid"width = "50%" height = "80%"

                      dataProvider="{dp2}">

                      <mx:columns>

                          <mx:DataGridColumn dataField="Title"/>

                      </mx:columns>

                  </mx:DataGrid>  

       

      I've found examples that seem to say this is possible, but nothing gets populated  into my data grid. What am I doing wrong?