| Paket | mx.collections |
| Arabirim | public interface IViewCursor extends IEventDispatcher |
| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
createCursor() method) the value of the
current property should be the first
item in the view, unless the view is empty.
| Özellik | Tanımlayan: | ||
|---|---|---|---|
| afterLast : Boolean [salt okunur]
If the cursor is located after the last item in the view,
this property is true . | IViewCursor | ||
| beforeFirst : Boolean [salt okunur]
If the cursor is located before the first item in the view,
this property is true. | IViewCursor | ||
| bookmark : CursorBookmark [salt okunur]
Provides access to a bookmark that corresponds to the item
returned by the current property. | IViewCursor | ||
| current : Object [salt okunur]
Provides access the object at the location
in the source collection referenced by this cursor. | IViewCursor | ||
| view : ICollectionView [salt okunur]
A reference to the ICollectionView with which this cursor is associated. | IViewCursor | ||
| Yöntem | Tanımlayan: | ||
|---|---|---|---|
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
EventDispatcher nesnesi olan bir olay dinleyici nesnesini, dinleyicinin bir olayın bildirimini alması için kaydeder. | IEventDispatcher | |
![]() |
Olay akışına bir olay gönderir. | IEventDispatcher | |
Finds an item with the specified properties within the collection
and positions the cursor to that item. | IViewCursor | ||
Finds the first item with the specified properties within the collection
and positions the cursor to that item. | IViewCursor | ||
Finds the last item with the specified properties within the collection
and positions the cursor on that item. | IViewCursor | ||
![]() |
EventDispatcher nesnesinin belirli bir olay türü için kayıtlı dinleyicisi olup olmadığını kontrol eder. | IEventDispatcher | |
Inserts the specified item before the cursor's current position. | IViewCursor | ||
Moves the cursor to the next item within the collection. | IViewCursor | ||
Moves the cursor to the previous item within the collection. | IViewCursor | ||
Removes the current item and returns it. | IViewCursor | ||
![]() |
EventDispatcher nesnesinden bir dinleyiciyi kaldırır. | IEventDispatcher | |
Moves the cursor to a location at an offset from the specified
bookmark. | IViewCursor | ||
![]() |
Bir olay dinleyicisinin bu EventDispatcher nesnesiyle mi, yoksa onun belirtilen olay türüne yönelik üst öğelerinden biriyle mi kayıtlı olduğunu kontrol eder. | IEventDispatcher | |
| Olay | Özet | Tanımlayan: | ||
|---|---|---|---|---|
| Dispatched whenever the cursor position is updated. | IViewCursor | |||
afterLast | özellik |
afterLast:Boolean [salt okunur] | Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
If the cursor is located after the last item in the view,
this property is true .
If the ICollectionView is empty (length == 0),
this property is true.
Bu özellik veri ciltleme kaynağı olarak kullanılabilir. Bu özellik değiştirildiğinde, cursorUpdate olayını gönderir.
Uygulama
public function get afterLast():BooleanbeforeFirst | özellik |
beforeFirst:Boolean [salt okunur] | Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
If the cursor is located before the first item in the view,
this property is true.
If the ICollectionView is empty (length == 0),
this property is true.
Bu özellik veri ciltleme kaynağı olarak kullanılabilir. Bu özellik değiştirildiğinde, cursorUpdate olayını gönderir.
Uygulama
public function get beforeFirst():Booleanbookmark | özellik |
bookmark:CursorBookmark [salt okunur] | Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Provides access to a bookmark that corresponds to the item
returned by the current property.
The bookmark can be used to move the cursor
to a previously visited item, or to a position relative to that item.
(See the seek() method for more information.)
Bu özellik veri ciltleme kaynağı olarak kullanılabilir. Bu özellik değiştirildiğinde, cursorUpdate olayını gönderir.
Uygulama
public function get bookmark():CursorBookmarkİlgili API Öğeleri
current | özellik |
current:Object [salt okunur] | Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Provides access the object at the location
in the source collection referenced by this cursor.
If the cursor is beyond the ends of the collection
(beforeFirst, afterLast)
this will return null.
Bu özellik veri ciltleme kaynağı olarak kullanılabilir. Bu özellik değiştirildiğinde, cursorUpdate olayını gönderir.
Uygulama
public function get current():Objectİlgili API Öğeleri
view | özellik |
view:ICollectionView [salt okunur] | Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
A reference to the ICollectionView with which this cursor is associated.
Uygulama
public function get view():ICollectionViewfindAny | () | yöntem |
public function findAny(values:Object):Boolean| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Finds an item with the specified properties within the collection and positions the cursor to that item. If the item can not be found, the cursor location does not change.
The findAny() method can only be called on sorted views;
if the view isn't sorted, a CursorError is thrown.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection. If one is already in progress, this method waits for it to complete before making another fetch request.
If multiple items can match the search criteria then the item found
is non-deterministic.
If it is important to find the first or last occurrence of an item
in a non-unique index, use the findFirst() or
findLast() method.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown.
Parametreler
values:Object — The search criteria. The values in the Object must be configured as name-value pairs,
as in an associative array (or be the actual object to search for). The values of the names specified must match properties
specified in the sort. For example, if properties x, y, and
z are in the current sort, the values specified should be
{x: x-value, y: y-value, z: z-value}.
|
Boolean — When all of the data is local this method returns
true if the item can be found and false
otherwise.
|
İlgili API Öğeleri
findFirst | () | yöntem |
public function findFirst(values:Object):Boolean| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Finds the first item with the specified properties within the collection and positions the cursor to that item. If the item can not be found, no cursor location does not change.
The findFirst() method can only be called on sorted views;
if the view isn't sorted, a CursorError is thrown.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection. If one is already in progress, this method waits for it to complete before making another fetch request.
If it is not important to find the first occurrence of an item
in a non-unique index, use findAny(), which may be
a little faster than the findFirst() method.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown.
Parametreler
values:Object — The search criteria. The values in the Object must be configured as name-value pairs,
as in an associative array (or be the actual object to search for). The values of the names specified must match properties
specified in the sort. For example, if properties x, y, and
z are in the current sort, the values specified should be
{x: x-value, y: y-value, z: z-value}.
|
Boolean — When all of the data is local this method returns
true if the item can be found and false
otherwise.
|
İlgili API Öğeleri
findLast | () | yöntem |
public function findLast(values:Object):Boolean| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Finds the last item with the specified properties within the collection and positions the cursor on that item. If the item can not be found, the cursor location does not chanage.
The findLast() method can only be called on sorted views;
if the view isn't sorted, a CursorError is thrown.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection. If one is already in progress, this method waits for it to complete before making another fetch request.
If it is not important to find the last occurrence of an item
in a non-unique index, use the findAny() method, which
may be a little faster.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown.
Parametreler
values:Object — The search criteria. The values in the Object must be configured as name-value pairs,
as in an associative array (or be the actual object to search for). The values of the names specified must match properties
specified in the sort. For example, if properties x, y, and
z are in the current sort, the values specified should be
{x: x-value, y: y-value, z: z-value}.
|
Boolean — When all of the data is local this method returns
true if the item can be found and false
otherwise.
|
İlgili API Öğeleri
insert | () | yöntem |
public function insert(item:Object):void| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Inserts the specified item before the cursor's current position.
If the cursor is afterLast,
the insertion occurs at the end of the view.
If the cursor is beforeFirst on a non-empty view,
an error is thrown.
Parametreler
item:Object — The item to insert before the cursor's current position.
|
moveNext | () | yöntem |
public function moveNext():Boolean| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Moves the cursor to the next item within the collection.
On success the current property is updated
to reference the object at this new location.
Returns true if the resulting current
property is valid, or false if not
(the property value is afterLast).
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
DöndürürBoolean — true if still in the list,
false if the current value initially was
or now is afterLast.
|
İlgili API Öğeleri
Örnek
Bu örnek nasıl kullanılır?
var myArrayCollection:ICollectionView = new ArrayCollection([ "Bobby", "Mark", "Trevor", "Jacey", "Tyler" ]);
var cursor:IViewCursor = myArrayCollection.createCursor();
while (!cursor.afterLast)
{
trace(cursor.current);
cursor.moveNext();
}
movePrevious | () | yöntem |
public function movePrevious():Boolean| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Moves the cursor to the previous item within the collection.
On success the current property is updated
to reference the object at this new location.
Returns true if the resulting current
property is valid, or false if not
(the property value is beforeFirst).
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
DöndürürBoolean — true if still in the list,
false if the current value initially was or
now is beforeFirst.
For example:
var myArrayCollection:ICollectionView = new ArrayCollection([ "Bobby", "Mark", "Trevor", "Jacey", "Tyler" ]);
var cursor:IViewCursor = myArrayCollection.createCursor();
cursor.seek(CursorBookmark.last);
while (!cursor.beforeFirst)
{
trace(current);
cursor.movePrevious();
}
|
İlgili API Öğeleri
remove | () | yöntem |
public function remove():Object| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Removes the current item and returns it.
If the cursor location is beforeFirst or
afterLast, throws a CursorError.
If you remove any item other than the last item,
the cursor moves to the next item. If you remove the last item, the
cursor is at the AFTER_LAST bookmark.
If the item after the removed item is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
DöndürürObject — The item that was removed.
|
İlgili API Öğeleri
seek | () | yöntem |
public function seek(bookmark:CursorBookmark, offset:int = 0, prefetch:int = 0):void| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Moves the cursor to a location at an offset from the specified
bookmark.
The offset can be negative, in which case the cursor is positioned
an offset number of items prior to the specified bookmark.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
Parametreler
bookmark:CursorBookmark — CursorBookmark reference to marker
information that allows repositioning to a specific location.
You can set this parameter to value returned from the
bookmark property, or to one of the following constant
bookmark values:
| |
offset:int (default = 0) — Indicates how far from the specified bookmark to seek.
If the specified number is negative, the cursor attempts to
move prior to the specified bookmark.
If the offset specified is beyond the end of the collection,
the cursor is be positioned off the end, to the
beforeFirst or afterLast location.
| |
prefetch:int (default = 0) — Used for remote data. Indicates an intent to iterate
in a specific direction once the seek operation completes.
This reduces the number of required network round trips during a seek.
If the iteration direction is known at the time of the request,
the appropriate amount of data can be returned ahead of the request
to iterate it.
|
İlgili API Öğeleri
cursorUpdate | Olay |
mx.events.FlexEventözellik FlexEvent.type =
mx.events.FlexEvent.CURSOR_UPDATE| Dil Sürümü: | ActionScript 3.0 |
| Ürün Sürümü: | Flex 3 |
| Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Dispatched whenever the cursor position is updated.
TheFlexEvent.CURSOR_UPDATE constant defines the value of the
type property of the event object for a cursorUpdate event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
Tue Jun 12 2018, 01:09 PM Z
Miras Alınan Genel Yöntemleri Gizle
Miras Alınan Genel Yöntemleri Göster