Sencha Touch 2.1 更新

简介: October 24, 2012 | Jamie Avins http://www.sencha.com/blog/whats-new-in-sencha-touch-2.1/ 啥更新了?What’s New? Sencha Touch 2.1 将是 Sencha 移动框架的下一新版本。

啥更新了?What’s New?

Sencha Touch 2.1 将是 Sencha 移动框架的下一新版本。2.1包括了下列关键更新:性能上的极大改进、正式支持图表、高级列表 List 控件,以及通过 Sencha Mobile Packager 的增强原生支持。

Sencha Touch 2.1 is our next release of the Sencha mobile framework. The 2.1 release includes the following key upgrades: significant performance improvements, charting support, an advanced list component, and enhanced native support through the Sencha Mobile Packager.

性能改进 Improved Performance

在 Sencha Touch 2.0 中令到开发者一点不爽的地方在于,进行内嵌布局的时候遭遇极大的性能问题。后来我们发现,只要把模板割裂开来,而且尽可能提供更多的信息给浏览器知道,即可改善该问题。这点优化不会影响 API 层面,但 DOM 结构以及某些 CSS 样式类就会不同。开发者在升级 Sencha Touch 2.1 的时候请注意这个变化,具体就是某些 CSS 选择器应该更新一下。

In Sencha Touch 2.0 some of our developers experienced nested layout performance issues. Our investigations found that by isolating panels and providing more layout information to the browser, the framework and your application can perform better. This implementation did not change our API, but some small changes to the DOM structure and additional CSS class names are now used to provide this enhancement. Developers of application with custom CSS should review their selectors with this update.

改进的地方还不止一点,当组件或元素控制可视之时则再不需要遍历 DOM,那是因为使用了 CSS 的 transitionEnd 的事件来检测 painted 事件。既然我们无法在 erased 事件中做到这一点,所以我们建议避免你这样做,因为它可能会降低性能。最后,我们新增了任务队列 TaskQueue  的机制,以便优化读、写的操作尤其批量的方式下的操作,因为批量读写很容易引发 DOM 回流。

Another under the hood performance improvement is a change to the ‘painted’ event which uses the CSS transitionEnd event to detect when elements and components are visible instead of having to traverse the DOM. Since we cannot do this for the ‘erased’ event, we recommend avoiding this event where you can as it can degrade performance.

Lastly, we have added a TaskQueue mechanism which helps us batch read or write operations together and prevent interleaving of DOM Read and Write operations in between internal DOM reflows.

图表Sencha Touch Charts

(……图表接触较少,而且篇幅,暂且不译……)

高级列表组件之无限翻页Advanced List component with Infinite scrolling


旧版实现 Formerimplementation

1. 新增了一项Only 1 additional item is loaded
2. 有更新一项,前面那一项被“循环再用”The component is recycled through the list with refreshed content

数据量一大,List 组件就吃不消!Sencha Touch 2.1 新的列表就是为了克服这一致命弱点而来的!此外,除了性能问题,控制列表项比以前更容易了,你只要配置好 itemConfig 和 itemTpl 两项就可以动态转为列表项配置结构,只需配置一次。奥秘在于,我们不但重构了 DOM 的结构,而且还重新设计了数据的绑定方式: 数据源 Data Store 和 DOM 元素之间不再一一对应。于是 DOM 结构包括样式肯定有所改变:例如,要修改列表项的内/外边距,你要把这样的 CSS 选择器“.x-list-item” 改为 “.x-list-item > .x-dock-horizontal > .x-dock-body”。看看例子 TouchTweets,可以反映上述的问题,里面都没有了 DataView,直接用新的列表控件替代。另外,例子中你还能看到新版插件 PullToRefresh 和 ListPaging。

Sencha Touch 2.1 also includes a new List component.The new implementation no longer has degraded performance when using lists with a large number of items in them. In addition, lists can use components if you specify them with an itemConfig and itemTpl will be converted to an itemConfig dynamically if you specify one. This is due to the list no longer being bound one-to-one between a Data Store and the DOM elements. Due to these changes, the DOM structure was altered for List, and you may need to change some CSS selectors to add appropriate styling to your lists. Typically, you need to change the selector from '.x-list-item' to '.x-list-item > .x-dock-horizontal > .x-dock-body' for any padding or margins you may have added. We changed the TouchTweets example with the new implementation; instead of using a component based DataView, it now uses the new List. It’s a good example of using the new List component with dynamic large lists. This example also shows the updated PullToRefresh and ListPaging plugins.

原生打包器 Enhanced Native Support through the Sencha Mobile Packager

Sencha Moblie Packager 包含在新版 Sencha Cmd 中。之前的版本仅是一个 SDK 工具,这次发布新增一个 native 打包器功能。你可以在测试机中、模拟器上面跑你的 apps,Packager 都为你准备好,可试试利用 Contact 联系人的 API 获取电话簿, iOS 或 Android 亦皆无问题。你可以对 packager 导入 iOS 的 info.plist 原始数据,安卓的话通过 rawConfig 导入 AndroidManifest.xml。根据大家的反馈,例如 packager 非管理员的访问这项需求,我们就实现了,——安装的时候不再需要管理员身份。

The Sencha Mobile Packager is included in the new Sencha Cmd, previously known as the SDK tools. In this release, we have enhanced native support. You can now directly run your app on your device as well as the simulator using the native packager. We have also added read only access to the device Contact API for both iOS and Android. The packager config also lets you pass in "raw" data to the iOS info.plist and Android AndroidManifest.xml through the rawConfig key. We also heard your feedback about non-admin access to the native packager, and we have updated the setup so admin access is no longer required.


交付日期 Availability

Sencha Touch 2.1 GA 将于十一月发出(——译注:已正式发布)。请关注我们的博客有关的报道。

Sencha Touch 2.1 GA will be publically available in November. Please watch our blog for the release announcement.


目录
相关文章
Meego touch实现页面跳转和返回
前面写完了第一个Meego touch的程序,相信大家也看到Meego touch的界面风格,显示效果等等。不过却没有页面跳转,和返回等效果,那这篇文章就研究下,如何实现页面的跳转和返回?Meego touch默认会通过返回键或者退出键实现当前页面的关闭,并且返回到前一个页面。
925 0
第一个MeeGo Touch程序
1.创建一个main.cpp文件,将下列代码加入到cpp文件中 #include #include #include #include int main(int argc, char **argv){ MApplication app(argc, argv); MApplicationWindow window; MApplicationPage page; page.
716 0
|
应用服务中间件 Android开发 前端开发
|
iOS开发
iOS开发--3D Touch的基本使用
1.桌面快捷菜单项 效果如图: 1.桌面快捷菜单项 效果如图: 1.桌面快捷菜单项 效果如图: 桌面快捷菜单 点击之后的效果如图: 点击桌面快捷菜单的效果 接下来看下具体实现:1).在-application:didFinishLaunchingWithOptions:方法中用-setShortcutItems:方法来添加快捷菜单项。
|
JavaScript 数据格式 JSON
|
Web App开发 网络架构
Sencha Touch 历史支持
路由、深链接以及后退按钮 Routing, Deep Linking and the Back Button Sencha Touch 2 提供完整的历史与深链接的支持,使得我们的 Web 应用拥有以下两点大的好处: 浏览器的“后退”按钮在你的应用中有效了,也就是说,虽然按下了后退键,但浏览器并不会立刻刷新,而是仍停留在当前的页面中。
877 0
|
Web App开发 JavaScript Android开发
touch详解
touch事件 前言 一个触屏网站到底和传统的pc端网站有什么区别呢,交互方式的改变首当其冲。例如我们常用的click事件,在触屏设备下是如此无力。 手机上的大部分交互都是通过touch来实现的,于是,对于触屏的交互式网站,触摸事件是相当重要的。
706 0