Get cursor position after removing an item from cursor : ArrayCollection Cursor « Data Model « 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 » Data Model » ArrayCollection CursorScreenshots 
Get cursor position after removing an item from cursor
Get cursor position after removing an item from cursor
          

<?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 = [{label:"A", data:"1"},
                                    {label:"B", data:"2"}
                                    {label:"C", data:"3"}];
        [Bindable]
        public var myAC:ArrayCollection;
        public var myCursor:IViewCursor;
        
        public function initData():void {
            myAC = new ArrayCollection(myArray);
        }
        public function testCollection():void {
            data.myCursor=myAC.createCursor();
            ta1.text="cursor is at: " + myCursor.current.label;
            var removedItem:String=String(myCursor.remove());
            ta1.text+="cursor is at: " + myCursor.current.label;
        }
      
    </mx:Script>
    <mx:ComboBox id="myCB" rowCount="7" dataProvider="{myAC}" />
    <mx:TextArea id="ta1" height="75" width="350" />
    <mx:Button label="run test" click="testCollection();" />
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Create IViewCursor from ArrayCollectionCreate IViewCursor from ArrayCollection
2.Move cursor to nextMove cursor to next
3.Seek last cursor positionSeek last cursor position
4.Find first item through a cursorFind first item through a cursor
5.Find item through cursorFind item through cursor
6.Seek the last cursor positionSeek the last cursor position
7.Get bookmark from CursorGet bookmark from Cursor
8.Get current cursor valueGet current cursor value
9.Create cursor from ArrayCollection and Move cursorCreate cursor from ArrayCollection and Move cursor
w___ww___.__j__a___v__a___2_s_.c__om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.