admin管理员组文章数量:1404594
What is the difference between store.load()
vs model.load()
? One uses callback
, the other uses success/failure
, with slightly different function signatures.
Other than that, is there any main difference to use store.load()
, OR not use it and just directly call model.load()
? Difference when loading nested models with relationships?
What is the difference between store.load()
vs model.load()
? One uses callback
, the other uses success/failure
, with slightly different function signatures.
Other than that, is there any main difference to use store.load()
, OR not use it and just directly call model.load()
? Difference when loading nested models with relationships?
1 Answer
Reset to default 4If you look at "Usage in Stores" section of Ext.data.Model documentation you'll find these two sentences:
A Store is just a collection of Model instances - usually loaded from a server somewhere. Store can also maintain a set of added, updated and removed Model instances to be synchronized with the server via the Proxy.
and
It is very mon to want to load a set of Model instances to be displayed and manipulated in the UI
So this means that store is typically used as a collection (or I would call it a repository) of many model instances that syncs data with defined backhand and maintains a list of model instances that can be filtered, queried etc.
On the other hand Ext.data.Model.load
method only loads one instance data by specific model id.
Based on this I would say that difference between Ext.data.Model.load
and Ext.data.Store.load
is in amount of data you want to load (one or many model instances).
本文标签: javascriptExtJs StoreLoad() vs ModelLoad()Stack Overflow
版权声明:本文标题:javascript - ExtJs Store.Load() vs Model.Load() - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744839770a2627852.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论