0 Replies Latest reply on Jul 22, 2008 7:54 AM by toegrimes

    XMLListCollection and DataGrid

    toegrimes
      I have a datagrid that is fed by an XMLListCollection dataprovider.

      I am trying to impliment a 'move up' / 'move down' feature with arrows
      so a user can reorder rows in the datagrid.

      I know reordering can be done via drag and drop, but does anyone have
      an example of what would effectively be a method looking like as
      follows:

      XMLListCollection.swapItems(item1Index:int, item2Index:int); //where
      the method effectively takes the items at the given indexes and swaps
      them round

      The idea being that you change the List Collection and the datagrid
      reflects these changes automatically (as is standard behaviour with
      dataproviders).

      I can ALMOST get it working but i think it doesnt like more than one
      change to the collection at once and it may require a eventListener for
      the second part of teh swap.

      Any ideas / examples?