1 Reply Latest reply on Nov 19, 2007 2:33 PM by ntsiii

    Using selection "presets"?

    Handycam Level 1
      In my application, I have pairs of drag-n-drop datagrids. The one on the left is populated with an XMLList of choices, and the user drags choices to the other grid, which I assign to an array collection.

      The left list, lets say its data provider is _listSource, and the other is _listDestination.

      _listSource is a list as in Red, Yellow, Green, Blue. What I'd like to add is the ability, on a prior screen, for the user to be able to select a "preset", e.g. "cool colors". If they select this, then Blue and Green should be added to _listDestination AND "removed" from _listSource. But the user still needs to be able to customize, let's say they drag "Green" back to the left list, where it needs to stay unless something else is chosen.

      This is a simplistic example to keep it simple, my actual app makes more sense :-)

      So I realize I can add Blue and Green to _listDestination, but how do I "remove" them from _listSource?
        • 1. Re: Using selection "presets"?
          ntsiii Level 3
          With XMLList, the only way to delete a node is to use the delete operator:
          delete myXMLList[n];

          With XMLListCollection, you can use xlc.removeItemAt(). The collection methods are very handy. You might as well go on and wrap the XMLList in an XMLListCollection. No reason not to, Flex does it behind the scenes if you do not.