DS.RecordArray

DS.RecordArray Class

Extends: Ember.ArrayProxy

Uses: Ember.Evented

Defined in: addon/-private/system/record-arrays/record-array.js:11

Module: ember-data

A record array is an array that contains records of a certain modelName. The record array materializes records as needed when they are retrieved for the first time. You should not create record arrays yourself. Instead, an instance of DS.RecordArray or its subclasses will be returned by your application's store in response to queries.

_unregisterFromManagerprivate

Defined in addon/-private/system/record-arrays/record-array.js:214

addInternalModel (internalModel) private

Defined in addon/-private/system/record-arrays/record-array.js:155

Adds an internal model to the RecordArray without duplicates

Parameters:

internalModel InternalModel

objectAtContent (index) DS.Modelprivate

Defined in addon/-private/system/record-arrays/record-array.js:99

Retrieves an object from the content by index.

Parameters:

index Number

Returns:

DS.Model
record

removeInternalModel (internalModel) private

Defined in addon/-private/system/record-arrays/record-array.js:169

Removes an internalModel to the RecordArray.

Parameters:

internalModel InternalModel

saveDS.PromiseArray

Defined in addon/-private/system/record-arrays/record-array.js:180

Saves all of the records in the RecordArray.

Example

var messages = store.peekAll('message');
messages.forEach(function(message) {
  message.set('hasBeenSeen', true);
});
messages.save();

Returns:

DS.PromiseArray
promise

update

Defined in addon/-private/system/record-arrays/record-array.js:112

Used to get the latest version of all of the records in this array from the adapter.

Example

var people = store.peekAll('person');
people.get('isUpdating'); // false

people.update().then(function() {
  people.get('isUpdating'); // false
});

people.get('isUpdating'); // true

contentEmber.Arrayprivate

Defined in addon/-private/system/record-arrays/record-array.js:28

The array of client ids backing the record array. When a record is requested from the record array, the record for the client id at the same index is materialized, if necessary, by the store.

isLoadedBoolean

Defined in addon/-private/system/record-arrays/record-array.js:40

The flag to signal a RecordArray is finished loading data.

Example

var people = store.peekAll('person');
people.get('isLoaded'); // true

isUpdatingBoolean

Defined in addon/-private/system/record-arrays/record-array.js:54

The flag to signal a RecordArray is currently loading data.

Example

var people = store.peekAll('person');
people.get('isUpdating'); // false
people.update();
people.get('isUpdating'); // true

storeDS.Storeprivate

Defined in addon/-private/system/record-arrays/record-array.js:71

The store that created this record array.

typeDS.Model

Defined in addon/-private/system/record-arrays/record-array.js:86

The modelClass represented by this record array.

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/data/classes/DS.RecordArray.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部