Extjs5.1中的新特性
Ext JS 5.0.1 is a maintenance release that addresses many bugs and limitations discovered by our community while testing Ext JS 5.0.0. We believe this update significantly strengthens the Ext JS 5 branch and we’re excited to hear your feedback. If you feel there are pieces missing from this guide, please let us know in the Ext JS 5 forums.
Let’s discuss a few of these improvements.
Accessibility
Ext JS 4.2.2 introduced the “ext-aria” package to provide improved support for accessibility, as described in the WAI-ARIA 1.0 standard. While this was an important step in creating accessible applications, we learned a lot from the feedback we received from our testing partners and early adopters. Ext JS 5.0.1 incorporates much of that feedback to provide a better solution moving forward.
Ext JS 5.0.1 re-introduces the concept of “ext-aria”, in addition to many other exciting improvements. Further, we have migrated support for focus and keyboard navigation from “ext-aria” to the framework’s core.
Focus
Ext JS 5.0.1 contains an improved strategy for the internal handling of focus. This internalization better aligns with accessibility standards. Core components, including buttons, tabs, form fields, and grids, now provide a clear, visual indication of focus. This is a key requirement for accessible applications. Users can modify several SASS variables and mixin parameters to gain more control over these new visual aspects.
Keyboard Navigation
Ext JS previously relied on Ext.FocusManager to assist in managing focus. While this class remains, it is no longer the recommended approach. It’s important to note that Ext.FocusManager has been deprecated and its future existence should not be relied upon. In its place, we have added a “focusable” property to components. This property is used to manage the tabIndex DOM attribute. Any component, with this property set to true, will be able to receive focus by clicking or via the keyboard input.
When these focusable components are placed in certain containers (such as toolbars), the container provides arrow key navigation and manages which item will receive the focus on entry into the container.
For more details regarding accessibility, focus, and keyboard navigation improvements, see the Accessibility Guide.
ViewModels
We have addressed a number of bugs related to viewModels, but there are some noteworthy improvements related to binding as well.
Selection Binding
Developers may now use “selection” as a bindable property on certain components. These components include ComboBox, Grids, Trees, Breadcrumbs, etc. Using the selection binding keeps the component selections in sync.
For details, see the Kitchen Sink example.
Model & Field Validation
One key improvement with form fields is that two-way bindings now check that the value is valid before updating their bound properties. The form fields can now acquire the Model’s validators and include them in their own validation.
As of Ext JS 5.0.1, invalid values will never be put back into your records.
Data
Ext.data has also been an area of a few key fixes and improvements in Ext JS 5.0.1.
TreeStore vs Node Events
The TreeStore class was refactored in Ext JS 5.0.0 to extend Ext.data.Store. With this change, TreeStore would relay events from the root node (Ext.data.NodeInterface). Unfortunately, certain node events collided with store events, which created problems for listeners. One such example was the “remove” event.
Ext JS 5.0.1 modifies the TreeStore strategy by prefixing all node events with “node” before firing them as TreeStore events. This means that the node’s “remove” event is now fired from the TreeStore as “noderemove”.
We always strive to avoid such changes in a maintenance release. However, this was a crucial change necessary to resolve the issue without breaking node listeners and/or store listeners.
Associations
Ext JS 5.0.0 introduced a lot of exciting new changes in terms of associations. However, one limitation that we discovered was that if you created a new record and then dropped that record, there was no cleanup logic to handle potential child records. This could create a situation where a session would generate create or update operations for these child records. These operations could not be processed by the server since the parent record was not saved.
Ext JS 5.0.1 offers reference fields that declare parent/child ownership between Models. These reference fields are then consulted when dropping records. When you indicate this type of association, dropped records will automatically handle deleting their child records.
For example:
In this way, when an Order it dropped (marked for deletion), its child OrderItems will likewise be dropped:
Further, setting parent references to null (for example, by removing it from the parent’s association store) schedules that record for cleanup.
The server is still ultimately responsible for a full cascade delete, but the above handling ensures that the client will never reference dropped records in save operations.
Responsive Configs
The new responsiveConfig provided by Ext.mixin.Responsive and Ext.plugin.Responsive provide flexibility for cleanly managing dynamic conditions.
The new responsiveFormulas allow you to add properties for responsiveConfig rules. For example, your main controller could do something like this to publish new properties:
These responsiveForumulas then produce these new values, which can be used in any of your responsiveConfig’s. This can help streamline your application’s responsiveConfigs, as well as give you a single place to maintain these kinds of choices.
Charts
The “sencha-charts” package also benefits from several improvements (such as some stock marker sprites like arrows, diamonds, etc). We’ve also modified our build process to include a packaged version of the sencha-charts package so that users aren’t required to use Sencha Cmd. However, the most significant of these that we documented and exposed custom theme creation.
Chart Themes
Ext JS 5.0.0 shipped charts with several built-in themes that you could select for your charts. However, building custom themes was not a documented process. With this release, we have opened up this ability so that you can make your own color palettes and much more.
A theme for charts is a class derived from Ext.chart.theme.Base and given an alias that starts with:
A basic theme could be as simple as this:
From here, you can add any number of other configs to style your series, axes and markers. To see all the options check out Ext.chart.theme.Base reference for the available configs.
To use the above you would simply set the “theme” config on your charts:
Sencha Cmd
Last but not least, Sencha Cmd 5.0.1 expands upon options available in app.json
. This gives you more fine-grained control to configure your application without having to delve into the build scripts.
Output
To give you a peek at the most useful of these new controls, let’s look at the “output” object. A common requirement for some environments is to maintain the “markup” file in a folder other than where the Sencha application resides. For example:
The difference with this model is that the markup file (“foo.php” above, but it could be anything) is in a parent folder. In previous releases, this required setting several build properties. In Sencha Cmd 5.0.1 we can now do this in app.json:
That single setting ensures that all paths will be calculated relative to the parent folder while also disabling the build step that rewrites the markup file. The “output” object can control many other aspects of your build’s output such from enabling compiler optimizations to tuning the microloader.
To learn more about these new available options, please open app.json
and review the robust commenting.
Packager
Cordova and PhoneGap are now much more flexible and easier to use with the new “packager” property. This new setting allows your build to specify its packager (either “cordova” or “phonegap”) directly in app.json
. Combined with the “builds” object, we can make an application that builds for web, iOS and Android. Further, we can specify local Cordova builds for Android and use the PhoneGap Cloud Build for iOS since iOS requires a Mac.
For example:
As before we can run a build like so:
The above will use the “web” build definition. But now we can also do these:
Of course, you will need to have Cordova and PhoneGap installed and you will also need to configure your PhoneGap Build account. Other than formalities, you can see how this property cleans up the build process. Using this approach also frees you up to add “testing” to any of these builds and get uncompressed JavaScript code for debugging.
Extjs5.1中的新特性的更多相关文章
- Extjs5.0中的新特性
We are excited that Ext JS 5 is now available! Ext JS 5 introduces many new and exciting improvement ...
- ASP.NET 5与MVC 6中的新特性
差点忘了提一句,MVC 6中默认的渲染引擎Razor也将得到更新,以支持C# 6中的新语法.而Razor中的新特性还不只这一点. 在某些情况下,直接在Web页面中嵌入某些JSON数据的方式可能比向服务 ...
- Webpack 3 中的新特性
本文简短地分享下最新发布的 Webpack 3 中的新特性,供大家参考. 1. Webpack 3 的新特性 6 月 20 日,Webpack 发布了最新的 3.0 版本,并在 Medium 发布了公 ...
- 使用示例带你提前了解 Java 9 中的新特性
使用示例带你提前了解 Java 9 中的新特性 转载来源:https://juejin.im/post/58c5e402128fe100603cc194 英文出处:https://www.journa ...
- HTML 5中的新特性
HTML 5中的新特性 html5新增了一些语义化更好的标签元素.首先,让我们来了解一下HTML语义化. 1.什么是HTML语义化? 根据内容的结构化(内容语义化),选择合适的标签(代码语义化)便于开 ...
- (数据科学学习手札73)盘点pandas 1.0.0中的新特性
本文对应脚本及数据已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1 简介 毫无疑问pandas已经成为基于Pytho ...
- 1 PHP 5.3中的新特性
1 PHP 5.3中的新特性 1.1 支持命名空间 (Namespace) 毫无疑问,命名空间是PHP5.3所带来的最重要的新特性. 在PHP5.3中,则只需要指定不同的命名空间即可,命名空间的分隔符 ...
- Firefox 23中的新特性(新陷阱)
话说有一天突然发现我们的网站页面上的JQuery功能都失效了,Firebug中显示如下的错误 Blocked loading mixed active content "http://xxx ...
- Python3中的新特性(3)——代码迁移与2to3
1.将代码移植到Python2.6 建议任何要将代码移植到Python3的用户首先将代码移植到Python2.6.Python2.6不仅与Python2.5向后兼容,而且支持Python3中的部分新特 ...
随机推荐
- linux的视频学习4(网络配置和rpm)
linux的视频学习: 1.网络配置的三种方式的介绍. 第一种方式: setup 命令--选择network configuration-->配置固定ip(tab键)和自动分配IP(长空格) / ...
- Mac系统Git生成ssh公钥
Mac系统Git生成ssh公钥 在使用Git仓库进行代码管理时,新的电脑上往往需要生成ssh公钥进行匹配,Mac系统生成Git公钥过程如下: 1.检查本机是否已有公钥 在终端中输入如下命令: ? 1 ...
- DrawerLayout和ActionBarDrawerToggle
说明:DrawerLayout的作用就是左侧滑出.右侧滑出菜单.需要和ActionBarDrawerToggle来配合使用.如果对ActionBar不理解,请先熟悉ActionBar. 1.首先配置D ...
- android笔记20170116
封装http请求类,利用回调机制获取返回值 public interface HttpCallbackListener { void onFinish(String response); void o ...
- js框架——angular.js(6)
1. ng-class 这个指令是用来绑定一个或者多个css代码.它的值一般是一个表达式,也可以是函数什么的,只要返回的确实是一个类的名字就可以—— ng-class="nextPageDi ...
- java包(package)
为了更好地组织类,java提供了包机制,用于区别类名的命名空间. 这样在不同的命名空间就可以有相同命名的类. 1 把功能相似或相关的类或接口阻止在同一个包中,方便类的查找和使用. 2 如同文件夹一样, ...
- maven学习笔记 1
1 概述 1.1 Maven是什么 1.2 为什么要用Maven 2 怎么用Maven 2.1 Maven仓库 2.2 Maven安装 2.3 Eclipse插件 2.4 Maven常用命 ...
- ERROR: No pool defined. at least one pool section must be specified in config file
root@ubuntu:/opt/php7# /opt/php7/sbin/php-fpm [22-Sep-2015 14:29:00] WARNING: Nothing matches the in ...
- android - 自定义(组合)控件 + 自定义控件外观
转载:http://www.cnblogs.com/bill-joy/archive/2012/04/26/2471831.html android - 自定义(组合)控件 + 自定义控件外观 A ...
- ural1542 Autocompletion
Autocompletion Time limit: 2.0 secondMemory limit: 64 MB The Japanese are infinitely in love with ma ...