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?

Share Improve this question asked Apr 30, 2013 at 7:45 TomTom 16.3k15 gold badges75 silver badges115 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

If 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