1

I have a flex datagrid that I would like to remove contents from after a button click event. If I use the removeItemAt(myGrid.selectedIndex) method it works fine but the removeAll() method does nothing. The addData() function you see here takes textinput values and sends them to the datagrid.

       [Bindable]
        public var originalData:ArrayCollection;

        [Bindable]
        public var changingData:ArrayCollection = new ArrayCollection();

        public function addData(e:MouseEvent):void
        {

            this.originalData = new ArrayCollection( );

            var obj:Object = new Object( );
            obj.Value = parseInt(myText.text)
            originalData.addItem( obj );

            this.changingData.addItem(obj);
        }

        public function clearList():void
        {
            this.changingData.removeAll()
        }
smulholland2
  • 1,143
  • 2
  • 14
  • 28

1 Answers1

0

This should work for you:

this.changingData = null;
Jacob Eggers
  • 9,062
  • 2
  • 25
  • 43
  • 1
    I had to add `changingData = new ArrayCollection();` after `this.changingData = null;` so that new values can be resubmitted from the text to the grid. – smulholland2 Jun 16 '11 at 18:34