Remove item at 0 position from a ComboBox : ComboBox Item « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » ComboBox Item 




Remove item at 0 position from a ComboBox
Remove item at 0 position from a ComboBox
       

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    initialize="initData()">
    <mx:Script>
        
        import mx.collections.*;
        public var myArray:Array = ["A""B""C""D""E""F"];
        
        [Bindable]
        public var myAC:ArrayCollection;
        public function initData():void {
            myAC = new ArrayCollection(myArray);
        }
        public function changeCollection():void {
            var oldLength:int = myAC.length;
        
            var removedItem:String = String(myAC.removeItemAt(0));
            
            ta1.text+=".\nRemoved " + removedItem;
        }
      
    </mx:Script>
    <mx:ComboBox id="myCB" rowCount="7" dataProvider="{myAC}" />
    <mx:TextArea id="ta1" height="75" width="300" />
    <mx:Button label="rearrange list" click="changeCollection();" />
</mx:Application>

   
    
    
    
    
    
    
  














Related examples in the same category
1.ComboBox prepopulated with list itemsComboBox prepopulated with list items
2.Get Item index for a ComboBoxGet Item index for a ComboBox
3.Add Item to second position in a ComboBoxAdd Item to second position in a ComboBox
4.Add item to a ComboBoxAdd item to a ComboBox
5.Sort ComboBox itemsSort ComboBox items
6.ComboBox form itemComboBox form item
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.