0 Replies Latest reply on Nov 13, 2007 10:28 AM by fuzzarooO

    Tilelist: removing an item but only last one gets removed?

    fuzzarooO
      Hi guys, I got a simple tilelist with an item render:

      mx:TileList id="roleList" horizontalScrollPolicy="off" click="{trace(roleList.selectedIndex);projectDataProvider.removeItemAt(roleList.selectedI ndex);trace(mx.utils.ObjectUtil.toString(projectDataProvider));}" dataProvider="{projectDataProvider}" itemRenderer="roleRow" />

      When i trace, i am selecting the correct tileList index, however, the item being removed is always the LAST ITEM in the tileList, but the correct item is being removed from the provider. Here's a trace of what my data provider looks like:

      quote:


      (mx.collections::ArrayCollection)#0
      filterFunction = (null)
      length = 3
      list = (mx.collections::ArrayList)#1
      length = 3
      source = (Array)#2
      [0] (Object)#3
      provider = (mx.collections::ArrayCollection)#4
      filterFunction = (null)
      length = 1
      list = (mx.collections::ArrayList)#5
      length = 1
      source = (Array)#6
      [0] (Object)#7
      assignment_label = "New York Tech"
      assignmentID = 5
      class1_data = 1
      class1_label = "New York"
      class2_data = 1
      class2_label = "Technology"
      has_been_modified = false
      has_saved_data = false
      is_new = false
      masterDataProvider = (mx.collections::ArrayCollection)#8
      filterFunction = (null)
      length = 1
      list = (mx.collections::ArrayList)#9
      length = 1
      source = (Array)#10
      [0] (Object)#11
      close0 = 0
      close1 = 0
      close10 = 0
      close11 = 0
      close12 = 0
      close13 = 0
      close14 = 0
      close15 = 0
      close16 = 0
      close17 = 0
      close18 = 0
      close19 = 0
      close2 = 0
      close20 = 0
      close21 = 0
      close22 = 0
      close23 = 0
      close24 = 0
      close25 = 0
      close26 = 0
      close27 = 0
      close28 = 0
      close29 = 0
      close3 = 0
      close30 = 0
      close31 = 0
      close32 = 0
      close33 = 0
      close34 = 0
      close35 = 0
      close36 = 0
      close4 = 0
      close5 = 0
      close6 = 0
      close7 = 0
      close8 = 0
      close9 = 0
      closingSum = NaN
      date0 = "05/01/07"
      date1 = "5/31/07"
      date10 = "2/25/08"
      date11 = "3/26/08"
      date12 = "4/25/08"
      date13 = "5/25/08"
      date14 = "6/24/08"
      date15 = "7/24/08"
      date16 = "8/23/08"
      date17 = "9/22/08"
      date18 = "10/22/08"
      date19 = "11/20/08"
      date2 = "6/30/07"
      date20 = "12/20/08"
      date21 = "1/20/09"
      date22 = "2/19/09"
      date23 = "3/21/09"
      date24 = "4/20/09"
      date25 = "5/20/09"
      date26 = "6/19/09"
      date27 = "7/19/09"
      date28 = "8/18/09"
      date29 = "9/17/09"
      date3 = "7/30/07"
      date30 = "10/17/09"
      date31 = "11/15/09"
      date32 = "12/15/09"
      date33 = "1/15/10"
      date34 = "2/14/10"
      date35 = "3/16/10"
      date36 = "4/15/10"
      date4 = "8/29/07"
      date5 = "9/28/07"
      date6 = "10/28/07"
      date7 = "11/26/07"
      date8 = "12/26/07"
      date9 = "1/26/08"
      total = 37
      uid = "BBC2EC49-6395-715C-5C40-3A3DC3313E7B"
      sort = (null)
      project_label = "Assignmnents WITH Saved Roles"
      projectID = 2
      role_data = 4
      role_label = "Front-end Developer"
      roleID = 4
      savedRoleID = 66
      segment_data = 1
      segment_label = "Core"
      timePeriod = 4
      uid = "D4CB53B3-08DB-8569-B634-3A3DC3AE17BC"
      sort = (null)
      source = (Array)#47
      quote: