开发者

How can I use Actionscript to clear data from datagrid?

开发者 https://www.devze.com 2023-03-13 22:44 出处:网络
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 nothin

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
        {

开发者_Go百科            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()
        }


This should work for you:

this.changingData = null;
0

精彩评论

暂无评论...
验证码 换一张
取 消