Combining Sencha Touch with jQuery

2020-07-16 09:42发布

问题:

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.

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?

回答1:

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).

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.

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?