3 Replies Latest reply on Jun 20, 2011 1:44 PM by EvyatarBH

    DataGrid - set dataProvider

    Zolotoj Level 3

      Here is my DataGrid:

      <s:DataGrid requestedRowCount="4" id="jobs">
                          <s:columns>
                              <s:ArrayList>
                                  <s:GridColumn dataField="job" headerText="Jobs"></s:GridColumn>
                                  <s:GridColumn headerText="Assign"></s:GridColumn>
                              </s:ArrayList>
                          </s:columns>
                      </s:DataGrid>

       

      // set data Provider

      private function showJobs(data:Object):void
                  {
                      jobs.dataProvider = new XMLListCollection(data.job); // error line
                      jobs.validateNow();
                  }

       

      data is:

      <root>

       

        <jobs>

       

          <job>0630EH    </job>

       

          <job>0630EI    </job>

       

          <job>0630WH    </job>

       

          <job>0630WY    </job>

       

          <job>0700WY    </job>

       

          <job>0730EH    </job>

       

          <job>0730WH    </job>

       

          <job>0759WY    </job>

       

          <job>0800CI    </job>

       

        </jobs>

       

      </root>

       

      and the error is:

      ReferenceError: Error #1069: Property job not found on String and there is no default value.

       

      Thanks for the help.