Document Status(文档状态)
This document is content-complete, but should still be considered DRAFT status. Please do not edit or translate yet — add all comments, questions, etc. to the discussion page. I plan on finalizing and "officially" publishing it for the 2.0 final release, but it is open now for public comment and technical review. —Brian
这篇文档已经基本完成了,但是它目前还仍是一篇草稿。请先不要编辑或翻译,请通过添加注释,提问等方式参与讨论。我计划在2.0最终版发布的时候发布一篇官方正式版本,目前只是一个公开的注释和技术回顾。
Introduction(简介)
Welcome to Ext 2.0. In the following sections, you will learn about all of the major new changes within Ext 2.0. You'll learn, at the high level, what new functionality exists and what you can do with it. However, as an overview, this guide will not discuss many of the details that you'll need as you embark on writing your own Ext 2.0 application. For additional information, here are some helpful resources:
欢迎使用Ext 2.0.在接下来的单节中,你会学习了解到在Ext 2.0中的所有关键修改的内容。你会在比较高的层面上了解到,它所具有的所有新的功能以及你该如何来使用它们。但是,作为一个介绍,在这个向导中在并不会讨论很多关于你在使用Ext 2.0开发程序时所需了解和掌握的更多具体细节。作为补充,这里有一些有用的资源链接:
- Ext 1.x to 2.0 Migration Guide
- Ext 2.0 API Reference
- Ext 2.0 Examples
- Ext 2.0 Change Log (Coming soon)
- Ext Community Forums
Summary of Major Changes(主要改变)
Here's a high-level summary of what's new in 2.0. Please note that there have been countless minor improvements, bug fixes and other changes across the framework from 1.x to 2.0. It would be impossible to list everything, so this overview is focused on the major areas of change where either the architecture has shifted, or there is some entirely new area of functionality. Each item is explained in complete detail in the sections following this summary.
这里会概要的总结一下在2.0中一些新的东西。请注意,从1.x到2.0框架的演变,做了无数的改进,BUG的修复还有其它很多的变化。我们不可能列出所有的变化,所以我们会把目光集中放在一些主要的变化上,诸如架构的改进,或者是完整的新功能。在后面的单节中,会针对下面介绍的每一项做功能做完整解释和介绍。
- Component Model(组件模型)
While the Component and BoxComponent classes existed in 1.x, they were not fully integrated throughout the framework. In 2.0, both classes have been greatly improved and now form the base of all major components. While these classes are intended to be mostly invisible to the developer, an understanding of the Component life cycle in 2.0 is fundamental to taking your Ext skills to the next level. Details
Component和BoxComponent类在1.x中已经是存在的,但是它们并没有完全的被集成和贯穿于整个框架中。在2.0中,这两个类都得到了很大的改进,现在框架中的主要组件都是从它们继承而来的。这两个类是希望对大多数开发者透明的,组件的生命周期的知识会在下一节中介绍。
- Container Model(容器模型)
There are now several fundamental classes available for building widgets and layouts that can contain other components. Container provides the fundamental framework for containment and layout of components, and is essential to the entire visual framework of Ext. Panel extends Container to provide base application-specific UI functionality, and is probably the most important class in the container hierarchy. Window is a special type of Panel that enables true desktop-style web applications, and Viewport is a utility container specifically designed for implementing full-browser-window web applications. Details
在现有的框架中提供了一些基础类,可以完全创建含有其它组件的widgets和布局。容器(Container)提供了可以包容和组件布局的基础框架,它是整个Ext可视框架的核心。从容器类扩展的面板(Panel)类提供了基本应用程序风格UI的功能,它可能是容器体系中最重要的一个类了。窗体类(Window)是一种特定的面板,提供了桌面风格WEB应用程序的支持。Viewport是为实现跨浏览器的window Web 应用程序而设计一个特定功能的容器组件。
- Layouts(布局)
In 1.x, layout was centered around the BorderLayout and its related classes. In 2.0, an entire layout architecture built on the new container and layout classes has been created. BorderLayout has now been joined by nine additional layout styles, and the class hierarchy has been redesigned for maximum extensibility. Layouts are also completely managed in 2.0, removing some of the complexities that developers faced when implementing complex layouts in 1.x. Details
在1.x中,布局都是围绕着BorderLayout和它的相关类而进行的。在2.0中,所有的整体布局架构都是基于新的容器和布局类来创建的。Border布局现在加了九种新的布局风格,所有的类的层次关系都是被重新设计过,以保证最大的扩展性。布局现在由2.0框架来完全拖管,去掉了在1.x中,开发人员需要面对的一些比较复杂的布局接口。
- Grid
The grid component has always been one of the centerpiece widgets in Ext, and with version 2.0 it has continued its evolution. New in this version is an even more polished user interface, improved performance, row grouping, summary rows, example custom plugins providing expandable rows and row numbering and much more. Details
Grid组件一直是Ext中具有核心地位的工具,在2.0中它仍然有一些改进。在新版本中,提供了更多优美的皮肤,性能的改进,行的分组,统计行,提供了自定义的插件来提供行的可扩展性,和行号支持,当然还有更多。
- XTemplate
The Template class in 1.x works great for simple templates, but lacks some key features for creating more advanced output. In 2.0, a new XTemplate class has been added that provides sub-templates, array processing, inline code execution, conditional logic and much more. Details
模板类(Template)在1.x中对简单模板支持的非常好,但是它在创建一些比较复要的输出时却有一些缺陷。在2.0中,提供了从模板类继承的一个新的XTemplate类,它可以处理数组,内联代码的执行,条件逻辑和其它一些功能。
- DataView
In 1.x, the View class provided templated data binding to generate customized UI views of data. The JsonView was a helper class for easily binding a template to JSON data. In 2.0, the capabilities of the View have been taken to the next level with DataView, which extends BoxComponent for easy addition to layouts and also supports the new XTemplate class for more powerful template processing. Details
在1.x中,视图类(View)是提供了生成个性化数据视图界面的数据绑定模板。JsonView是一个可以简单的将JSON数据绑定到模板的辅助类。在2.0中,View类的功能已经被DataView所取代,它是从BoxComponent扩展,带有非常简单的布局功能,同时支持新的XTemplate类,可以进行更加复杂模板处理。
- Other New Components(其它新的组件)
Several new components and widgets have been added in 2.0, including Action, CycleButton, Hidden (field), ProgressBar and TimeField. Details
在2.0中增加了一些新的组件和工具,包括Action, CycleButton, Hidden (field), ProgressBar and TimeField.
Additional notes:
- Themes
The out-of-the-box theme support in 2.0 has been somewhat simplified. Ext supported four different themes in 1.x, but in 2.0 that number has been reduced to two ("Ext Blue" and Gray). Custom themes can easily be added using the Gray theme's stylesheet as an implementation example, and a community theme site is planned. While this is not a code API change, it is a noteworthy change nonetheless that is worth mentioning.
皮肤的黑箱支持在2.0里变得非常的简单。Ext在1.x的时候提供了4种不同的皮肤,但是在2.0中变成了两种("Ext Blue" and Gray)。自定义皮肤可以效仿内置的Gray皮肤例子那样重新样式表来简单的设计和添加,还计划开设皮肤交流社区。值得注意的是,这完全是不需修改任何的API代码。
- Breaking Changes(不足)
Unfortunately, there are a few changes in 2.0 that could not maintain backwards compatibility to 1.x. Because the underlying component and rendering models changed substantially, some existing components had to be rewritten in ways that were fundamentally incompatible with their 1.x counterparts. We have provided a 1.x to 2.0 Migration Guide that will hopefully ease the burden of upgrading an existing Ext 1.x application.
不幸人就,2.0的一些变化无法保持向下兼容的能力。因为基本组件和输出模型都发生了根本性的变化,一些原来已存在的组件被以一种不可兼容的方式重写过了。我们提供了1.x to 2.0 Migration Guide,希望能减轻从现有的EXT 1.x升级的负担。