- 浏览: 129442 次
- 性别:
- 来自: 杭州
最新评论
-
amwons:
学习了,谢谢
优化JVM参数提高eclipse运行速度 -
yaoyaoershang:
究
优化JVM参数提高eclipse运行速度 -
hehaibo:
-startupplugins/org.eclipse.equ ...
优化JVM参数提高eclipse运行速度 -
hehaibo:
beckrabbit 写道受此文启发: 随想配置:更快的启动e ...
优化JVM参数提高eclipse运行速度 -
robin35java:
刚接触了jvm,我会了Myeclipse条jvm参数,这样就可 ...
优化JVM参数提高eclipse运行速度
TabPanelItem to Panel
Note that while the TabPanelItem events are all supported by Panel, event handlers will now be called with a Panel object instead of a TabPanelItem, so any handling logic might have to change accordingly.
Properties | ||
TabPanelItem(tabPanel, id, text, closable) | see notes | TabPanelItems in 1.x only existed for the purpose of residing in a TabPanel, thus they had a very specific constructor argument list. There is no direct replacement as Panels are generic and the constructor is config-based. However, the following code would be equivalent when adding a new Panel to a TabPanel (note that a separate container config is not needed in this example since the Panel is being directly added):tabPanel.add(new Ext.Panel({ |
bodyEl | body | |
closeText | — | The tab's close button no longer supports configurable tooltip text in 2.0. |
id | getId() | The id property is now private in 2.0 and the inherited Component getId method should be used instead. |
tabPanel | ownerCt | Every Component in 2.0 supports the ownerCt property which returns a reference to the owning Container. |
Methods | ||
activate | show (Component) | When a Panel is added into a TabPanel as a tab, its normal show method will activate it within the TabPanel. |
getText | title [property] | The standard Panel title is used as the tab text when the Panel is added to a TabPanel. |
getUpdateManager | getUpdater | This returns the update manager for the Panel's body element. |
isActive | — | Panels have no knowledge of whether or not they are active. Instead you could check tabPanel.getActiveTab().getId() == 'my-panel' . |
isHidden | hidden [property] | The standard Component hidden property can be used so no method is necessary. |
refresh, setUrl |
load, getUpdater().refresh |
In 1.x, refresh used the properties set in setUrl to reload remote content into the tab. In 2.0, Panels can be loaded directly using the load method, or you can access the update manager directly via getUpdater and either load the Panel or refresh it using previously loaded configuration data. |
setContent | body.update | Equivalent functionality. |
setHidden | setVisible | Same functionality, although note that these methods are now reversed. setHidden(true) in 1.x should now be setVisible(false) and vice versa. |
setText | setTitle | |
setTooltip | — | No longer supported in 2.0 |
Upgrading Forms for 2.0 (TBD)
Ext.form.Form - Rename the class anywhere it's used to Ext.form.FormPanel
.
FormPanel now extends Ext.Panel in 2.0 so that it gets automatic layout handling. The following methods are no longer supported:
- column
- fieldset
- container
- start
- end
Ext.form.Layout
- Replaced Ext.form.Layout with Ext.layout.FormLayout
- Changed Fieldset to extend Ext.layout.FormLayout instead of Ext.form.Layout
Upgrading BasicDialog to Window
BasicDialog and Window API Comparison
The BasicDialog class no longer exists in 2.0, and has been replaced by the more general-purpose Window class. Window is based on Panel, so it can participate in the standard Component lifecycle, as well as acting as a standard Container and supporting 2.0 layouts. The table below summarizes the API differences between BasicDialog and Window, and offers tips on upgrading to Window when relevant. Only members that have been changed or removed are listed.
Config Options | ||
autoCreate | — | No longer needed, as Window automatically renders from code unless a content element is specified (e.g., via the applyTo config). |
autoTabs | autoTabs (TabPanel) | In 2.0, tab functionality has been completely factored out of the Window class. Anytime tabs are needed, a TabPanel should be created, and it has the autoTabs config that works just like the BasicDialog version did in 1.x. Note that the required CSS classes for identifying tab content in existing markup have changed (see the examples below for details). |
constraintoviewport | constrain, constrainHeader |
There are now two separate functions, one for constraining the entire Window to the viewport, and one for constraining only the header element while allowing the Window body to overflow. |
fixedcenter | — | The behavior of auto-centering the Window anytime it is displayed or programmatically resized is not supported by default in 2.0. However, it would be easy to add if needed by simply monitoring the Window's resize and/or beforeshow events and calling Window.center() . |
proxyDrag | — | Windows only support proxy dragging in 2.0, so it's no longer an option. |
syncHeightBeforeShow | — | No longer needed in 2.0 as internal box dimensions are managed automatically by the Window. |
tabTag | autoTabSelector (TabPanel) | The functionality is the same, but is now specified in the TabPanel config. |
Methods | ||
BasicDialog(el, config) | Window(config) | Aside from the supported config object being different, the Window constructor does not take an element as the first argument. Instead, the standard 2.0 approach to specifying the element is by using the renderTo config value or passing the el into the render method. |
addButton | addButton | In 2.0, buttons must be added prior to rendering. The preferred approach in 2.0 is to specify all buttons in the buttons config for the Window rather than calling this method, but it is supported if needed. |
addKeyListener | keys, keyMap |
A valid KeyMap config object can be passed as the Window's keys config to add listeners at config time. You can also access the Window's internal KeyMap object directly via the keyMap property. |
collapse | collapse([animate]) | New optional argument to animate the effect. |
destroy([removeEl]) | destroy() | Argument removed — the el will always be removed on destroy in 2.0. |
expand | expand(animate) | New optional argument to animate the effect. |
getTabs | items (Container), Ext.getCmp() |
Since Containers in 2.0 can hold any type of Component, there is no point in having component-specific getters. Instead, you can access the Container's items MixedCollection and use any of the available methods for retrieving any component by id, index, selector, etc. Alternatively, any Component can be retrieved at any time by id from the ComponentMgr by calling Ext.getCmp('id') . |
hide([callback]) | hide([animateTarget], [callback], [scope]) | Additional arguments available (callback moved to second argument). |
initTabs | readTabs(true) (TabPanel) | The functionality is the same, but is now specified in the TabPanel readTabs method. The optional removeExisting argument will remove any existing tabs if true is passed (initTabs always removed existing tabs). |
moveTo | setPosition | The functionality is the same, but is now specified by the BoxComponent base class. |
resizeTo | setSize | The functionality is the same, but is now specified by the BoxComponent base class. |
restoreState | — | State management is now handled automatically by the Component base class. If a state provider is initialized, the Window will automatically persist and reload its state. |
setContentSize | — | No longer needed in 2.0 as internal box dimensions are managed automatically by the Window. |
setTitle(title) | setTitle(title, [iconCls]) | New optional argument to set the window icon. |
show([animateTarget]) | show([animateTarget], [callback], [scope]) | New optional arguments. |
Events | ||
keydown | — | This event is no longer fired by Window. All keydown handling should be provided via the Window's internal KeyMap object. |
resize(this, width, height) | resize(this, adjustedWidth, adjustedHeight, rawWidth, rawHeight) | New arguments for the original width and height have been added. |
Simple Dialog Example
This is the simplest possible dialog, built dynamically in code. These two blocks produce dialogs that have equivalent basic functionality.
Implementation Notes:
- In 1.x you had to use autoCreate to create a dialog programmatically, and you had to update the body element to add content through code — in 2.0 the Window will create itself programmatically by default, and you can use the html config to add content.
- In 2.0, Windows have shadows by default, so the config is only needed to turn them off.
- The proxyDrag config is no longer supported — Windows can only be proxy-dragged.
- In 1.x the dialog had a minimize tool button that collapsed/expanded the dialog by default. In 2.0, there is not a default behavior for the minimize action since in a desktop-style application, the true default might be to minimize to a task bar or some other container. However, it is simple to add the 1.x default behavior by adding the minimize tool config option along with a simple event handler as shown below.
- 2.0 does have an addButtons method too, but adding them in the config is preferred. Buttons must be added prior to rendering!
- The addKeyListener method has been replaced by the keys config that allows you to pass a valid KeyMap config that defines all the keys to be handled by the Window.
var dialog = new Ext.BasicDialog(null, { |
var win = new Ext.Window({ |
Tabbed Dialog From Markup Example
This is a slightly more complex dialog that demonstrates rendering from existing HTML markup, as well as automatically generating tabs in the dialog from the markup.
Implementation Notes:
- Note that the dialog CSS classes have changed. In 1.x, the header was "x-dlg-hd" and the body was "x-dlg-bd". These are now "x-window-header" and "x-window-body". Note that "x-window-body" is not actually used in this example since the TabPanel is added to the body programmatically by passing it in the items config. However, you could just as easily create a div for static content with the class "x-window-body" and it would render into the body as expected.
- The tab-related classes have also changed. Tabs are now generic in 2.0, so there is no need for dialog-specific class names like "x-dlg-tab". Now content anywhere in the page with the class "x-tab" can be added to any TabPanel component.
- The TabPanel is now created as a separate component since the tab functionality has been factored out of the Window class. Since Window is a Container subclass, it can contain any components (including TabPanel) by simply passing them into its items config.
- In 2.0, the applyTo config is used to apply a component to existing markup.
|
|
var dialog = new Ext.BasicDialog("markup-dlg", { |
var win = new Ext.Window({ |
Upgrading LayoutDialog to Window
In 1.x, a separate LayoutDialog class was required to embed a BorderLayout into a dialog. In 2.0, the LayoutDialog no longer exists — any Container can contain any style of layout, so it's now as simple as giving the Window a layout config value of 'border' and adding Panels as needed. This example also demonstrates the use of many new config options in the 2.0 code. They will not all be covered here, but are all documented in the Ext 2.0 API docs.
Implementation Notes:
- In the "Tabbed Dialog From Markup" example above, we added a TabPanel directly inline by defining it inside the items config. In this example, each component is constructed separately and then later added into the Window's items config by reference. This is a convenient way of creating references that you can keep for later use if needed (although any component, including Panels and TabPanels, can be accessed at any time via
Ext.getCmp('id')
). - Note that you can even mix building the Window contents in multiple ways. The Window container and header elements are defined in markup using the applyTo config. The center tab and west region are populated by explicitly defining their contentEl configs, pointing them at the elements containing their contents. The secondary tab contains content defined inline via the html config. There are many options for building layouts from contents in 2.0!
- One subtle difference is how you can apply custom styles to the contents. In the 1.x example, an inline style declaration was required in the markup to add padding to the panel bodies. In 2.0, there is a special bodyStyle config that allows you to apply custom body styles in code. In this example, passing that in the defaults config simply applies it to each contained item (the 'nav' and 'tabs' components).
|
|
var dialog = new Ext.LayoutDialog("layout-dlg", { |
var tabs = new Ext.TabPanel({ |
Upgrading QuickTips for 2.0 (TBD)
- QuickTips class has been broken out into Tip, QuickTip (class), QuickTips (singleton) and Tooltip
- Changed width tag attribute to qwidth to avoid browser attribute conflicts
Config Options | ||
animate | ||
autoDismiss | ||
autoDismissDelay | ||
autoHide | ||
cls | ||
hideDelay | ||
hideOnClick | ||
interceptTitles | ||
maxWidth | ||
minWidth | ||
showDelay | ||
text | ||
title | ||
trackMouse | ||
width |
Converting View to DataView (TBD)
- Extends BoxComponent instead of Observable
- View used Ext.Template, DataView uses Ext.XTemplate
- itemSelector config is a new required property
- JsonView no longer exists as a separate class
Converting MasterTemplate to XTemplate
Template API Changes
member formatting functions | |||
VARIABLE:this.METHOD(arguments) | this.METHOD(arguments) | {[this.METHOD(arguments)]} | The syntax to execute member formatting functions has changed slightly through revisions. In 2.0 you can execute your member functions anywhere including in the new conditional if attribute. |
tpl attributes | |||
name | for | for | The name attribute was changed to a for attribute. You must provide the name of a valid object or array instead of an arbitrary name to fill. |
Methods | |||
add | — | — | No longer needed due to auto-filling of arrays. Use a for attribute with the same name of your array. |
addAll | — | — | No longer needed due to auto-filling of arrays. Use a for attribute with the same name of your array. |
fill | — | — | No longer needed due to auto-filling of arrays. Use a for attribute with the same name of your array. |
reset | — | — | No longer needed due to auto-filling of arrays. Use a for attribute with the same name of your array. |
set | — | — | Create a new XTemplate via the constructor. |
Converting to XTemplate
- Change any name attributes to a for attribute. If you previously used an unnamed tpl which you were filling, you will now need to give it a for attribute.
- Change the value of the for attribute to a valid object/array which will be in the variable you are applying
- Change the syntax of member formatting functions
- Apply an object which meets the specs of your template
For Example:
var iconTpl = new Ext.MasterTemplate('<fieldset><legend>{title}</legend><
tpl><img src="{img}" width="16" height="16" /> {desc}<br/></tpl></fieldset>');
var tplObj = {title: 'Order Legend'};
var iconArray = [
{img: 'images/icons/cog_orange.png', desc: 'Active Order'},
{img: 'images/icons/stop.png', desc: 'Cancelled Order'},
{img: 'images/icons/tick.png', desc: 'Completed Order'}
];
iconTpl.compile();
iconTpl.fill(iconArray);
iconTpl.append(document.body, tplObj);
Could be converted to:
var iconTpl = new Ext.XTemplate('<fieldset><legend>{title}</legend><tpl
for="iconArray"><img src="{img}" width="16" height="16" /> {desc}<br/></tpl><
/fieldset>');
var tplObj = {
title: 'Order Legend',
iconArray: [
{img: 'images/icons/cog_orange.png', desc: 'Active Order'},
{img: 'images/icons/stop.png', desc: 'Cancelled Order'},
{img: 'images/icons/tick.png', desc: 'Completed Order'}
]
};
iconTpl.compile();
iconTpl.append(document.body, tplObj);
Minor API Changes
This section outlines all minor breaking API changes that only affect isolated members of a class, as opposed to a significant majority of a class's API or the class's underlying functionality. These changes are generally simple to diagnose and should only require minimal modifications to upgrade existing code.
Ext.Element | |||
getNextSibling | next |
|
You can optionally pass a CSS selctor in 2.0 as the first arg (instead of null) for custom filtering, and next returns an Element by default (1.x always returned a DOM node), so pass true as the second arg for a DOM node. |
getPreviousSibling | prev |
|
You can optionally pass a CSS selctor in 2.0 as the first arg (instead of null) for custom filtering, and prev returns an Element by default (1.x always returned a DOM node), so pass true as the second arg for a DOM node. |
Ext.EventManager | |||
wrap | — |
|
This was required in 1.x to wrap event handlers and override the default returned browser event object with an Ext.EventObject. This is now the default behavior in 2.0, so wrap can simple be removed. |
Ext.MessageBox | |||
getDialog : BasicDialog | getDialog : Window |
|
For details on interacting with a Window instead of a BasicDialog, see the section in this document on migrating to Ext.Window. |
updateProgress(value, text) | updateProgress(value, progressText, msg) |
|
By default, the progress text (second arg) will move from the window body into the progress bar itself between 1.x and 2.0. While technically a breaking (behavioral) change, most people will probably find the new default 2.0 behavior more desirable, so this will usually require no change in code. The new optional third argument will update the window body as the second argument did in 1.x. |
Ext.form.Field | |||
applyTo() | applyToMarkup(), or applyTo [config] |
|
The behavior of creating components from existing markup was moved into the Ext.Component base class so that all components implement it consistently, and the method was renamed to applyToMarkup so as not to conflict with the config property applyTo . The behavior and results should be exactly the same. |
Ext.grid.EditorGrid | |||
EditorGrid(container, config) | EditorGridPanel(config) |
|
EditorGrid now extends GridPanel instead of Grid to take advantage of the 2.0 layout architecture, and so was renamed to EditorGridPanel. It also uses the 2.0 Component model which requires that the only argument to the constructor is a config object. |
Ext.tree.TreePanel | |||
TreePanel(container, config) | TreePanel(config) |
|
TreePanel now extends Ext.Panel instead of Ext.data.Tree to take advantage of the 2.0 layout architecture. It also uses the 2.0 Component model which requires that the only argument to the constructor is a config object. |
beforeexpand, expand, beforecollapse, collapse |
beforeexpandnode, expandnode, beforecollapsenode, collapsenode |
|
These events were renamed to reflect the fact that they are actually node events, not tree events. |
发表评论
-
五种开源协议的比较(BSD,Apache,GPL,LGPL,MIT) - 整理
2009-10-20 09:45 1672现今存在的开源协议很多,而经过Open Source Init ... -
翻译了下palm程序审批指南,可以上传程序卖钱了
2009-08-20 21:54 1523从今天开始开发者可以提交免费或者收费的palm程序进行评审,细 ... -
给想到上海工作的兄弟的话
2008-02-22 14:19 1459坛子里的人说的不错 转过来 准备来上海的兄弟们.我来提醒你们 ... -
EXT在线教程
2007-12-14 15:08 1792不错的教程 标题我很喜欢 就像在看圣斗士 问题是经常打不开 h ... -
ext1.x to ext2.0升级指南1(转自官方)
2007-10-23 11:05 4216官方网站速度太慢了 转到自己这里 Ext 1 to 2 Mig ... -
Hql语句注意事项总结(转载)
2007-10-18 11:37 11148Hql语句注意事项总结(转载) 1.在Hql中使用grou ...
相关推荐
EXT.NET.WEBFORMS.PRO.2.5.2.0 是EXT.NET专业版的一个特定版本,专注于为ASP.NET Web Forms开发提供丰富的用户界面组件和功能。EXT.NET Pro是一款基于JavaScript和HTML5的UI库,它扩展了ASP.NET的Web Forms模型,...
1. **Ext2.0官方文档(chm)**: 这是Ext 2.0的官方帮助文档,通常以CHM(Microsoft Compiled HTML Help)格式提供,便于离线查阅。文档中详细介绍了Ext 2.0的所有类、方法、属性和事件,是学习和开发Ext 2.0应用的重要...
唉,当然他们说英文不好懂,于是,我就看完了Ext官方网站的介绍,然后把该网站介绍--Ext2.0开发指南完整翻写成了简体中文,并且使用Ext2.2调试出来,因为--该官方网站给出的是Ext 2.0版本,有的代码跑不出来,比如...
9. **向后兼容性**: 由于EXT2.0的许多变化是根本性的,一些1.x的组件需要重构以适应新版本。EXT提供了升级指南来帮助开发者平稳过渡。 EXT2.0的这些改进和新特性显著提升了EXT框架的易用性和灵活性,使得开发者能够...
### 关于Ext2.0:深入理解与应用 #### 标题解读:“ext2.0” “ext2.0”通常指的是Ext JS框架的2.0版本,这是一款基于JavaScript的开源前端框架,用于构建复杂且高性能的Web应用程序。Ext JS提供了一套丰富的UI...
EXT 2.0版本是EXT框架的一个重要里程碑,它在EXT 1.x的基础上进行了大量的改进和优化,提供了更加强大且灵活的组件库,以及更丰富的用户界面功能。 EXT的核心特性包括: 1. **组件化**:EXT 2.0拥有一个丰富的组件...
在“MyHotelManager”这个压缩包中,可能包含了EXT 2.0酒店管理系统的源代码、数据库脚本、安装指南、示例数据等相关文件。通过学习和研究这些文件,开发者或酒店管理人员可以深入理解系统的架构和工作原理,进行...
本教程旨在为那些刚刚接触Ext2.0的学习者提供一个全面而系统的入门指南。 #### Ext2简介 Ext2是专门为Linux设计的一种文件系统,它在Ext(第一扩展文件系统)的基础上进行了大量改进,提供了更好的性能、稳定性和...
EXT2.0中文帮助文档是针对EXT JavaScript库的详细指南,旨在为中文用户提供了全面、易懂的技术支持。EXT是一个强大的前端开发框架,主要用于构建富互联网应用程序(Rich Internet Applications,RIA)。EXT库以其...
这个合集包括四本重要的PDF书籍,分别是EXT经典.pdf、ExtJS开发手册.pdf、ExtJS快速开发入门指南.pdf以及ExtJs入门实例.pdf,每本书都针对EXT2.0的不同方面提供了深入的讲解。 EXT经典.pdf这本书可能是EXT2.0的基础...
"EXT2.0中文教程.pdf"很可能是EXT2.0的全面指南,它可能包含了以下关键知识点: 1. **EXT基础**:讲解EXT的基本概念,如如何创建一个简单的EXT应用,以及如何引入和配置EXT库。 2. **组件使用**:详细介绍EXT的...
EXT_JS实用开发指南是针对使用EXT JS框架进行Web应用程序开发的详细指导。EXT JS是一个强大的JavaScript库,主要用于构建用户界面,尤其适用于企业级应用。在使用EXT JS时,首先需要在HTML页面中引入必要的库文件,...
标题中的“Ext中文版+Jscript+css2.0+J2EE+Editplus+Dhtml”涵盖了多个IT领域的关键知识点,这些技术都是构建现代Web应用程序的重要组成部分。 1. **Ext**: Ext是一个JavaScript库,主要用于构建富客户端的Web应用...
3. "ext2.0官方文档 .rar":这是Ext JS 2.0的官方文档,可能包含了详细的API参考、示例和教程,帮助开发者深入理解该版本的功能。 4. "EXT 教程.rar":这可能是一系列关于Ext JS的教程集合,可能包括实例、实践项目...
1. **主题(Theme)**:在Ext2.0中,主题是决定应用程序视觉风格的关键元素,包括颜色、字体、布局等。通过更换主题,开发者可以快速改变应用的整体外观,以适应不同的品牌需求或用户偏好。这12个主题包可能包含了...
C.1. 2007年12月5日,迷茫阶段 C.1.1. 仇恨 C.1.2. 反省 C.2. 关于ext与dwr整合部分的讨论 C.3. 怎么看文档附件里的范例 C.4. ext开发计划 D. 贡献者列表 D.1. 感谢[飘]的大力支持 D.2. 感谢[吧啦吧啦]的大力支持 D....
这个实用简明教程可能涵盖了EXT2.0的所有内容,并且可能深入到EXT3.x或更高版本的特性,如EXT JS的Grid Panel(表格面板)的高级功能、数据存储和远程数据加载、图表组件、拖放操作以及自定义组件的开发。...
标题中的"ext2.0中文语言包gb2312格式"指的是EXT JS框架的2.0版本的一个中文语言包,该包采用了GB2312编码格式。EXT JS是一个广泛使用的JavaScript库,用于构建富互联网应用程序(RIA)。它提供了一套完整的组件模型...