Create cursor from ArrayCollection and Move 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 
Create cursor from ArrayCollection and Move cursor
Create cursor from ArrayCollection and Move cursor
          

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" creationComplete="init()">
    <mx:Script>
        
            import mx.collections.SortField;
            import mx.collections.Sort;
            import mx.collections.IViewCursor;
            import mx.collections.CursorBookmark;
            import mx.collections.ArrayCollection;

            [Bindable]
            private var coll:ArrayCollection;

            [Bindable]
            private var cursor:IViewCursor;

            private function init():void {
                coll = new ArrayCollection([{city:"A", state:"C", region:"E"},  
                                            {city:"B", state:"D", region:"F"}]);
                cursor = coll.createCursor();
            }
    
      
    </mx:Script>
    <mx:Label text="{cursor.current.city}"/>
    <mx:Button click="cursor.moveNext()" label="Next"/>
    <mx:Button click="cursor.movePrevious()" label="Previous"/>
</mx:VBox>
</mx:Application>  

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