1 Reply Latest reply on Jun 2, 2007 7:36 PM by AwesomeDigital3

    Help With addItem Please

    AwesomeDigital3 Level 1
      I have an Array Collection whose source is a node of an XML file such as this

      individualsArray = event.result.PhoneDirectory.People.Person

      The XML looks like this
      <Person FirstN="Jane" LastN="Doe" Sex="F" ACode="312" Phone="466-8300" Dept="New Business Services" HireD="2004-06-01" BirthMonth="" BirthDay="" Loc="Schaumburg" Floor="1" Area="N" Note="" MailStop="8805"/>

      How do I use individualsArray,addItem to add an item to the array?

      I tried creating and object then using that with addItem, but I do not see the item in the DataGrid that is using the array as it's source.

      Thanks
      Mathias

      I was trying something like this
      var strFNameLabel:String = "";
      var strFNameData:String = "";
      var strLNameLabel:String = "LName";
      var strLNameData:String = "";
      var strACodeLabel:String = "ACode";
      var strACodeData:String = orphansArray[c].ACode;
      var strPhoneLabel:String = "Phone";
      var strPhoneData:String = ""
      var newItem:Object;

      strFNameLabel = "FName";
      strFNameData = "Name Here";
      strLNameLabel = "LName";
      strLNameData = " Last Here";
      strACodeLabel = "ACode";
      strACodeData = "312"
      strPhoneLabel = "Phone";
      strPhoneData = "312";

      newItem = {label:strFNameLabel, data:strFNameData, label:strLNameLabel, data:strLNameData, label:strACodeLabel, data:strACodeData,label:strPhoneLabel, data:strPhoneData};

      individualsArray.addItem(newItem);