ExtJS_4_官方指南翻译:Grid组件.doc

  1. 1、本文档共14页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
ExtJS_4_官方指南翻译:Grid组件

?ExtJS 4 官方指南翻译:Grid组件(上) 分类:?ExtJS 4.02011-10-18 16:41?501人阅读?评论(2)?收藏?举报 原文:/ext-js/4-0/#!/guide/grid 翻译:frank/sp42 转载请保留本页信息 Grids Grid 面板为 Ext JS 的大头核心之一。它是一个通用性很强的组件,提供了一个简单的方式来显示、排序(sort)、分组(group)和编辑(edit)数据。 The?Grid Panel?is one of the centerpieces of Ext JS. Its an incredibly versatile component that provides an easy way to display, sort, group, and edit data. 基本Grid面板 Basic Grid Panel 让我们开始创建一个基本的 Grid 面板。通过这个例子你可以学习到创建 Grid 的基本方法并让 Grid 顺利地跑起来。 Lets get started by creating a basic?Grid Panel?. Heres all you need to know to get a simple grid up and running: 模型对象 Model 和 Store 存储对象 Model and Store 一个 Grid 面板可以说仅仅是一个组件,它会把 Store 中的数据显示出来。Store 可以被看作是一记录集合,或模型的实例。欲了解更多 Store 和模型的信息,建议参阅该文。这种设计的好处是“各司其职(separation of concerns)”,并且十分清晰。Grid 面板只关注如何显示的数据,而 Store 则透过用其代理(Proxy)执行数据的获取和保存。 A?Grid Panel?is simply a component that displays data contained in a?Store. A?Store?can be thought of as a collection of records, or?Model?instances. For more information on?Stores and?Models see the?Data guide. The benefit of this setup is clear separation of concerns. The Grid Panel?is only concerned with displaying the data, while the?Store?takes care of fetching and saving the data using its?Proxy. 首先,我们需要定义一个模型。模型只是一种集合,表示一个数据类型的字段。让我们定义一个模型,它代表着“用户User”: First we need to define a?Model. A?Model?is just a collection of fields that represents a type of data. Lets define a model that represents a User: view plain Ext.define(User,?{?? ????extend:?Ext.data.Model,?? ????fields:?[?name,?email,?phone?]?? });?? 接下来,我们创建一个包含多个用户 User 的 Store对象。Next lets create a?Store?that contains several?Userinstances. view plain var?userStore?=?Ext.create(Ext.data.Store,?{?? ????model:?User,?? ????data:?[?? ????????{?name:?Lisa,?email:?lisa@,?phone:?555-111-1224?},?? ????????{?name:?Bart,?email:?bart@,?phone:?555-222-1234?},?? ????????{?name:?Homer,?email:?home@,?phone:?555-222-1244?},?? ????????{?name:?Marge,?email:?marge@,?phone:?555-222-1254?}?? ????]?? });?? 为了简单起见,我们直接写出 Store 其具体数据。而在真实的应用

文档评论(0)

xcs88858 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档