译自:http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Model
原文:A Store is just a collection of Model instances
Store就是多个model实例的集合。
这里的model实例相当于 java中的对象,Model就相当于Class,一个Model可以有多个实例,相当于 一个java类有多个对象(实例)一样。
model利用proxy 通过向 服务器 请求数据 并 加载 封装到 model实例当中。
Store can also maintain a set of added, updated and removed Model instances to be synchronized with the server via the Proxy.
Store 也可以 存储 通过Proxy代理 同步 新增、修改和删除服务器中 的数据 到 Model 实例中。
个人理解,打个比喻:
Store如果看成是 一张数据库表,
record(s)就是 表中的记录 (行),
Model 代表(封装)了表的字段信息(属性)。
例如js:
Ext.widget('groupSelectStaffPanel').store.removeAll();
这里groupSelectStaffPanel是一个View,它自身绑定了一个Store ,这个store自身又绑定了一个Model ,
removeAll()方法就是 删除 store中所有的 model实例。