将Sencha Touch与jQuery结合 [英] Combining Sencha Touch with jQuery

查看:88
本文介绍了将Sencha Touch与jQuery结合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Sencha Touch中工作了几周,尽管该框架非常强大,但我仍然发现它难以使用的地方,尤其是用于复杂嵌套JSON结果的JSONP数据存储.结果,我决定结合jQuery的有用的AJAX和JSON函数,以将项目添加到已经用Sencha Touch编码的DataStore中.

I have been working in Sencha Touch for a few weeks now, and while the framework is very powerful, I still find areas of it difficult to work with, particularly the JSONP data stores for complex nested JSON results. As a result, I decided to combine the useful AJAX and JSON functions of jQuery for adding items to a DataStore already coded in Sencha Touch.

我只是想知道是否还有其他人在使用Sencha Touch的API时遇到类似的困难,并且一直在框架中使用jQuery.这会对性能产生什么影响,建议仅使用Sencha Touch方法吗?

I just wondered if anyone else has similar difficulties with the API for Sencha Touch, and has been using jQuery with the framework. What are the performance implications of this, and is it advisable to use only Sencha Touch methods?

推荐答案

我在基于Sencha Touch的应用程序中包含了jQuery,到目前为止,还没有发现任何问题.我主要使用jQuery来访问和更新自定义HTML代码中的值(例如,Sencha Touch组件的html属性中的内容).

I am including jQuery in my Sencha Touch based application and so far haven't seen any problems with it. I'm using jQuery mostly for accessing and updating values in my custom HTML code (e.g. stuff inside the html attribute of a Sencha Touch component).

如果您包括另一个库(jQuery),它自然会更沉重,但我认为性能上的差异并不明显.但是,我只在浏览器上进行了测试,而没有在移动设备上进行过测试.如果用户在移动设备上使用3G连接,则性能差异可能会更加明显.

It will naturally be more heavy if you include another library (jQuery) but the difference in performance is not noticeable in my opinion. I have only however tested on the browser and not on a mobile device. The difference in performance could be more noticeable if the user is using a 3G connection on a mobile device.

但是,如果我是您,那么从数据存储中添加/删除内容时,我可能会使用现有的API.您发现将数据存储区与现有API结合使用会遇到什么困难?

But if I were you, I would probably use the existing API when it comes to adding/removing stuff from a DataStore. Which part do you find difficult in using a DataStore with the existing API?

这篇关于将Sencha Touch与jQuery结合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆