第五天(Using the Data Package in Sencha Touch)

来源:互联网 发布:新还珠格格知画生孩子 编辑:程序博客网 时间:2024/05/17 19:16

Using the Data Package in Sencha Touch

使用st中的数据包

The data package is responsible for loading and saving all data in a Sencha Touch app. Most of the actions involving the data package are related to models, stores, and proxies:

数据包是用来加载、保存st应用程序中数据的。数据包的大部分行为与模型、数据存储、代理有关:

  • Model: A model represents an entity your app cares about. User, Contact, Address, and Product could all be models. At its simplest, a model is just a collection of fields and their data, but they can do a lot more.
  • 模型:一个模型代表这你的app所关心的实体。用户、联系人、地址、产品都可以是模型。最简单情况下,模型是一系列字段及其数据的集合,但他们能完成很多功能。
  • Store: A store is a collection of model instances. Mostly it is just a glorified array, but it also provides capabilities like sorting, filtering, and grouping, and it is capable of firing useful events.
  • 数据存储:数据存储是模型实例的集合。通常它是一个数组类型的,但是它也提供诸如排序、过来、分组等功能,也能够触发一些有用的事件。
  • Proxy: A proxy is responsible for the actual loading and saving of data into a store. Usually you will create an AJAX proxy which fetches data from your server and uses it to populate a store.
  • 代理:代理负责将数据加载、保存至数据存储中。通常你会创建一个ajax代理将数据从服务器段取过来并用它来填充数据存储。

Find out more about Models, Stores and Proxies in their individual guides.

关于模型、数据存储、代理的更多信息可以查看各自的文档。

Further Reading

延伸阅读

Data is only a part of the Sencha Touch ecosystem. To understand more about the framework and how it works, we recommend reading the following guides:

数据只是st系统的一部分。为了更好的理解该框架及它是如何工作的,推荐阅读如下内容:

  • Components and Containers 组件和容器
  • The Class System 类系统
  • The Layout System 布局系统
  • Getting Started
原创粉丝点击