Lines Matching refs:list

2 Provides an API for managing an ordered list of Model instances.
5 @submodule model-list
10 Provides an API for managing an ordered list of Model instances.
13 methods for managing the models in the list, ModelLists are also bubble targets
15 you can add several models to a list, and then subscribe to the `*:change` event
16 on the list to be notified whenever any model in the list changes.
34 Fired when a model is added to the list.
37 added to the list. Calling `e.preventDefault()` during the `on` phase will
41 been added to the list.
52 before the model is actually saved or added to the list. The `add` event
53 will be fired after the model has been saved and added to the list.
63 duplicate model to the list, or when a sync layer response can't be parsed.
73 list and can't be added again). The model in question will be provided
78 list and can't be removed). The model in question will be provided as
96 Fired when a model is removed from the list.
99 removed from the list. Calling `e.preventDefault()` during the `on` phase
103 been removed from the list.
113 Fired when the list is completely reset via the `reset()` method or sorted
116 Listen to the `on` phase of this event to be notified before the list is
118 the list from being reset.
120 Listen to the `after` phase of this event to be notified after the list has
124 @param {Model[]} models Array of the list's new models after the reset.
139 The `Model` class or subclass of the models in this list.
201 Adds the specified model or array of models to this list. You may also pass
202 another ModelList instance, in which case all the models in that list will
208 list.add(new Model({foo: 'bar'}));
211 list.add({foo: 'bar'});
214 list.add([
220 list.add(otherList);
251 models in this list.
257 var list = new Y.ModelList({model: Y.Model});
259 list.comparator = function (model) {
266 to other models in this list.
273 list if the server indicates success.
319 Executes the supplied function on each model in this list. Returns an array
330 var filtered = list.filter(function (model) {
336 var filteredList = list.filter({asList: true}, function (model) {
348 @param {ModelList} callback.list The ModelList being filtered.
359 i, item, len, list;
376 list = new Y.ModelList({model: this.model});
377 filtered.length && list.add(filtered, {silent: true});
378 return list;
387 of the specified attribute from each model in this list.
406 list.
428 list.
472 Calls the named method on every model in the list. Any arguments provided
498 Loads this list of models from the server.
564 Executes the specified function on each model in this list and returns an
570 @param {Number} fn.index Index of the current model in the list.
580 Called to parse the _response_ when the list is loaded from the server.
616 Removes the specified model or array of models from this list. You may also
643 Completely replaces all models in the list with those specified, and fires a
654 the models in that list will be added to this list. Calling `reset()`
655 without passing in any models will clear the list.
695 Forcibly re-sorts the list.
697 Usually it shouldn't be necessary to call this method since the list
699 the `comparator` function after items are already in the list, you'll need
734 list. The default method just calls the callback without actually doing
742 * `create`: Store a list of newly-created models for the first time.
743 * `delete`: Delete a list of existing models.
744 * `read` : Load a list of existing models.
745 * `update`: Update a list of existing models.
769 Returns an array containing the models in this list.
772 @return {Array} Array containing the models in this list.
779 Returns an array containing attribute hashes for each model in this list,
782 Under the hood, this method calls `toJSON()` on each model in the list and
798 Adds the specified _model_ if it isn't already in this list.
801 the list, an `error` event will be fired and the model will not be added.
827 error: 'Model is already in the list.',
846 Adds this list as a bubble target for the specified model's events.
849 @param {Model} model Model to attach to this list.
853 // Attach this list and make it a bubble target for the model.
859 Clears all internal state and the internal list of models, returning this
860 list to an empty state. Automatically detaches all models in the list.
892 Removes this list as a bubble target for the specified model's events.
909 the sort order of the list.
945 Removes the specified _model_ if it's in this list.
964 error: 'Model is not in the list.',
984 Array sort function used by `sort()` to re-sort the models in the list.
1062 // When fired from the `sort` method, we don't need to clear the list or