2 Replies Latest reply on May 28, 2009 4:59 PM by scorptique

    remove/add items into repeater

    scorptique

      Hey guys, how do I add/remove items from the repeater's array? Because when I delete the item from the database, it still displays itself on the repeater so I have to remove it from the array (or arrayCollection? =S) as well. How to do that?

       

       

      //The Repeater component with "profileData" being the HTTPservice's id. Display user's addresses-------------------

       

      <mx:Repeater id="addRepeater" dataProvider="{profileData.lastResult.MainProfile.address}">
                          <mx:Grid >
                              <mx:GridRow>
                                  <mx:GridItem id="griditem1">
                                    <mx:TextArea text="{addRepeater.currentItem.street}, Singapore {addRepeater.currentItem.postal}" id="textarea1"/>
                                         </mx:GridItem>
                                             <mx:GridItem>
                                                   <mx:LinkButton click="deleteItem(event)" id="delete_add" label="delete"/>
                                                   <mx:LinkButton label="edit" click="edit(event)" id="edit_add"/>                       
                                             </mx:GridItem>
                                   </mx:GridRow>
                          </mx:Grid>
      </mx:Repeater>

       

       

      //The XML generated tags from a PHP file which data is extracted from the database------------------------------------------------------

       

      <MainProfile>
      <address street="xxxxxxx" postal="xxxxxx"/>
      <address street="xxxxxxxxx" postal="xxxxxx"/>
      <address street="xxx xxxx" postal="xx xxx"/>
      <profile email="xxxxx@hotmail.com" password="xx" fName="xxxxx" lName="xxx" contact="xxxxxxxx" gender="x" IC="xxx xxx xxxx"/>
      </MainProfile