Field Summary |
public
| canSort: Boolean |
| Does this list support sorting
|
|
public static
| classInfo: Object |
| A static class information object
|
|
public
| selectFirstOnLoad: Boolean |
| Controls whether the first record in the dataSource is selected when the list loads
|
|
| Fields inherited from class xp.data.DataSourceautoCommit, autoEdit, autoInsert, calcFields, classInfo, deltaPacket, itemClassName, logChanges, newDataItem, nodeName, usesManualCommit |
|
|
|
Property Summary |
public
| data (read)
|
| Get or set the data object encapsulated by this datasource
|
|
public
| data: Object (write)
|
|
|
|
public
| inline: XMLNode (read, write) |
| sets inline data from Fluid*
|
|
public
| items: Array (read, write) |
| Gets or sets the array encapsulated in this dataSource
|
|
public
| length: Number (read-only)
|
| The number of record in the list
|
|
public
| list: Array (read, write) |
| Gets or sets the array encapsulated in this dataSource
|
|
public
| lookupField: String (read, write) |
|
|
|
public
| position: Number (read, write) |
| The position of the current record pointer in the list The same as SelectedIndex
|
|
public
| selectedIndex: Number (read, write) |
| Gets or set the current item’s index in the collection. The same as Position
|
|
|
|
Constructor |
public
| ListDataSource (
list: Array)
|
| Create a new ListDataSource instance
|
|
Method Summary |
public
| addDataRelation (
parentColumns: Object, childSource: ListDataSource, childColumns: Object
): DataRelation |
| Adds a data relation to the data source
|
|
public
| addItem (
item: Object
): Void |
| Adds a data item to the end of the list
|
|
public
| addItemAt (
index: Number, item: Object
): Void |
| Adds a data item at a specified position
|
|
public
| addItemsAt (
index: Number, items: Array
): Void |
| Insert a series of item starting at the given index
|
|
public
| editField (
index: Number, fieldName: String, newData: Object
): Void |
| Edits one field in the non-current record
|
|
public
| first (
): Boolean |
| Move to the first record
|
|
public
| getClass (
): Function |
| Returns a reference to the components static class
|
|
public
| getFieldValue (
index: Number, fieldName: String
): Object |
| Gets data in a user-editable format - relaxed return type
|
|
public
| getItemAt (
index: Number
): Object |
| Retrieves a data item independent of the current cursor position-part of the IList interface
|
|
public
| getIterator (
): ListItemIterator |
| Gets an iterator for this list
|
|
public
| getKeyValue (
item: Object, cols: Array
): Object |
| extract the key value from the record
|
|
public
| isEmpty (
): Boolean |
| Indicates whether the collection contains any items
|
|
public
| isFirst (
): Boolean |
| Is the current record the first record in the list
|
|
public
| isLast (
): Boolean |
| Is the current record the last record in the list
|
|
public
| last (
): Boolean |
| Move to the last record
|
|
public
| locateById (
id: String
): Boolean |
| Indicates whether the collection contains any items
|
|
public
| lookup (
key: String, select: Boolean
): Object |
|
|
|
public
| moveBy (
inc: Number
): Boolean |
| Move the record pointer by an increment
|
|
public
| next (
): Boolean |
| Move to the next record
|
|
public
| prior (
): Boolean |
| Move to the previous record
|
|
public
| removeAll (
): Array |
| Remove all items from the list
|
|
public
| removeItem (
): Void |
| Removes the current data item
|
|
public
| removeItemAt (
index: Number
): Object |
| Remove a data item at the given index
|
|
public
| removeItemsAt (
index: Number, len: Number
): Array |
| Remove a series of items from the list
|
|
public
| replaceItem (
item: Object
): Void |
| Replace the current data item
|
|
public
| replaceItemAt (
index: Number, item: Object
): Void |
| Replace a data item at the given index
|
|
public
| setFieldValue (
index: Number, fieldName: String, newData: Object
): Void |
| Edits one field
|
|
public
| setFilter (
filter: Function
): Void |
| Filters the items by calling a filter function which returns true if the items passes the filter
|
|
public
| setKeyConstraint (
v: Object
) |
|
|
|
public
| sortItems (
compareFunc: Function, options: Number
): Void |
| Sort the list using a custom function
|
|
public
| sortItemsOn (
fieldName: String, options: Number
): Void |
| Sort the list items
|
|
| Methods inherited from class xp.data.DataSourceapplyChanges, applyUpdates, cancelChanges, checkSchema, commitChanges, createItem, deleteItem, editItem, getClass, insertItem, rollbackChanges, toString, validate |
|
|
|
|
Each item is an object composed of many fields of data.
A ListDataSource expose 2 interfaces;
The IDataSource interface which expose the current item through the data property
The IList interface wheich exposes the collection of data items.
The currentItem can be changed by moving the selectedIndex of the IList interface.
You can access any item by index (as you can with an array), using getItemAt() on the IList interface.
Event summary for the ListDataSource class
The following table lists events of the ListDataSource class.