Lee![]()
Global object that keeps track of models via a register method. Registered models
are put into ModelList instances that are maintained by the store. The lists are
keyed by the name of the model and can be retrieved by the getList method.
Simple example of creating a model and registering it with the store, then using the store to find it.
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.04.18-20-14'
}).use('gallery-model-store', function(Y) {
var FooModel = Y.Base.create('fooModel', Y.Model, [], {}, {});
var m = new FooModel({id: 1});
Y.ModelStore.registerModel(m);
var fm = Y.ModelStore.find('fooModel', 1);
// -- or --
var fm = Y.ModelStore.find(FooModel, 1);
});
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info