DataSet class

Inheritance MovieClip > DataSet

ActionScript Class Name mx.data.components.DataSet

The DataSet component lets you work with data as collections of objects that can be indexed, sorted, searched, filtered, and modified.

The DataSet component functionality includes DataSetIterator, a set of methods for traversing and manipulating a data collection, and DeltaPacket, a set of interfaces and classes for working with updates to a data collection. In most cases, you don't use these classes and interfaces directly; you use them indirectly through methods provided by the DataSet class.

Method summary for the DataSet class

The following table lists the methods of the DataSet class.

Method

Description

DataSet.addItem()

Adds the specified item to the collection.

DataSet.addItemAt()

Adds an item to the data set at the specified position.

DataSet.addSort()

Creates a new sorted view of the items in the collection.

DataSet.applyUpdates()

Signals that the deltaPacket property has a value that you can access using data binding or ActionScript.

DataSet.changesPending()

Indicates whether the collection has changes pending that have not yet been sent in a delta packet.

DataSet.clear()

Clears all items from the current view of the collection.

DataSet.createItem()

Returns a newly initialized collection item.

DataSet.disableEvents()

Stops sending DataSet events to listeners.

DataSet.enableEvents()

Resumes sending DataSet events to listeners.

DataSet.find()

Locates an item in the current view of the collection.

DataSet.findFirst()

Locates the first occurrence of an item in the current view of the collection.

DataSet.findLast()

Locates the last occurrence of an item in the current view of the collection.

DataSet.first()

Moves to the first item in the current view of the collection.

DataSet.getItemId()

Returns the unique ID for the specified item.

DataSet.getIterator()

Returns a clone of the current iterator.

DataSet.getLength()

Returns the number of items in the data set.

DataSet.hasNext()

Indicates whether the current iterator is at the end of its view of the collection.

DataSet.hasPrevious()

Indicates whether the current iterator is at the beginning of its view of the collection.

DataSet.hasSort()

Indicates whether the specified sort exists.

DataSet.isEmpty()

Indicates whether the collection contains any items.

DataSet.last()

Moves to the last item in the current view of the collection.

DataSet.loadFromSharedObj()

Loads all of the relevant data needed to restore the DataSet collection from a shared object.

DataSet.locateById()

Moves the current iterator to the item with the specified ID.

DataSet.next()

Moves to the next item in the current view of the collection.

DataSet.previous()

Moves to the previous item in the current view of the collection.

DataSet.removeAll()

Removes all the items from the collection.

DataSet.removeItem()

Removes the specified item from the collection.

DataSet.removeItemAt()

Removes a data set item at a specified position.

DataSet.removeRange()

Removes the current iterator's range settings.

DataSet.removeSort()

Removes the specified sort from the DataSet object.

DataSet.saveToSharedObj()

Saves the data in the DataSet object to a shared object.

DataSet.setIterator()

Sets the current iterator for the DataSet object.

DataSet.setRange()

Sets the current iterator's range settings.

DataSet.skip()

Moves forward or backward by a specified number of items in the current view of the collection.

DataSet.useSort()

Makes the specified sort the active one.

Property summary for the DataSet class

The following table lists the properties of the DataSet class.

Property

Description

DataSet.currentItem

Returns the current item in the collection.

DataSet.dataProvider

Returns the data provider.

DataSet.deltaPacket

Returns changes made to the collection, or assigns changes to be made to the collection.

DataSet.filtered

Indicates whether items are filtered.

DataSet.filterFunc

User-defined function for filtering items in the collection.

DataSet.items

Items in the collection.

DataSet.itemClassName

Name of the object to create when assigning items.

DataSet.length

Specifies the number of items in the current view of the collection.

DataSet.logChanges

Indicates whether changes made to the collection, or its items, are recorded.

DataSet.properties

Contains the properties (fields) for any transfer object in this collection.

DataSet.readOnly

Indicates whether the collection can be modified.

DataSet.schema

Specifies the collection's schema in XML format.

DataSet.selectedIndex

Contains the current item's index in the collection.

Event summary for the DataSet class

The following table lists the events of the DataSet class.

Event

Description

DataSet.addItem

Broadcast before an item is added to the collection.

DataSet.afterLoaded

Broadcast after the items property is assigned.

DataSet.calcFields

Broadcast when calculated fields should be updated.

DataSet.deltaPacketChanged

Broadcast when the DataSet object's delta packet has been changed and is ready to be used.

DataSet.iteratorScrolled

Broadcast when the iterator's position is changed.

DataSet.modelChanged

Broadcast when items in the collection have been modified in some way.

DataSet.newItem

Broadcast when a new transfer object is constructed by the DataSet object, but before it is added to the collection.

DataSet.removeItem

Broadcast before an item is removed.

DataSet.resolveDelta

Broadcast when a delta packet is assigned to the DataSet object that contains messages.


Flash CS3