sencha-touch-2

Sencha Touch 2 - prevent a-href events (a-href event handling)

我只是一个虾纸丫 提交于 2019-12-01 05:17:48
in my Sencha Touch 2 application I need to handle redirection events on my own. By this I mean I need to be able to handle a href events and do the redirection myself. I'm using the following code: Ext.Viewport.element.addListener("tap", function(e) { e.stopEvent(); e.stopPropagation(); e.preventDefault(); var href = e.target.getAttribute("href"); // ... my code ... }, this, {delegate: "a"}); By none of the above mentioned functions work (stopEvent, stopPropagatioon, preventDefault). The application always opens the link in my app web view. Is here any possible way to disable a href opening

Sencha Touch 2 native build vs wrapping Sencha Touch 2 in Phonegap

可紊 提交于 2019-12-01 05:11:43
I know there are a few questions pitting Sencha Touch 2 against Phonegap, and that is not what I mean to do here. I have been planning to build my Webapp using Sencha Touch 2 and wrapping it in Phonegap; but I just found out that Sencha Touch 2 also all allows you to build a native version of your web-app for Android and ios using there command line tool. Why haven't I heard much about this solution? What are the limitations with doing this? And what is better, using Sencha Touch 2's native build feature or going the Sencha Touch 2 + Phonegap route? I'm guessing that Sencha Touch 2 native

Sencha Touch 2 - prevent a-href events (a-href event handling)

心已入冬 提交于 2019-12-01 02:44:10
问题 in my Sencha Touch 2 application I need to handle redirection events on my own. By this I mean I need to be able to handle a href events and do the redirection myself. I'm using the following code: Ext.Viewport.element.addListener("tap", function(e) { e.stopEvent(); e.stopPropagation(); e.preventDefault(); var href = e.target.getAttribute("href"); // ... my code ... }, this, {delegate: "a"}); By none of the above mentioned functions work (stopEvent, stopPropagatioon, preventDefault). The

Sencha Touch 2 native build vs wrapping Sencha Touch 2 in Phonegap

淺唱寂寞╮ 提交于 2019-12-01 02:09:06
问题 I know there are a few questions pitting Sencha Touch 2 against Phonegap, and that is not what I mean to do here. I have been planning to build my Webapp using Sencha Touch 2 and wrapping it in Phonegap; but I just found out that Sencha Touch 2 also all allows you to build a native version of your web-app for Android and ios using there command line tool. Why haven't I heard much about this solution? What are the limitations with doing this? And what is better, using Sencha Touch 2's native

How to cache subcomponents instance inside components

随声附和 提交于 2019-12-01 01:58:47
问题 A lot of Sencha Touch examples I found online, don't really focus on proper view encapsulation. So the Controller listens to every single button's event even if the button is deep nested inside a view. In other words the internals of the view leak through which is never a good thing. I found one good tutorial that encourages you to create meaningful views that listen to local events and raise meaningful business events etc. http://miamicoder.com/2012/how-to-create-a-sencha-touch-2-app-part-2/

Warning saying `Id` exist and should be destroyed

假如想象 提交于 2019-11-30 16:23:22
Most of the time i see the following Warning, when i click on the same button for more than once (when calling the same function twice or more) [WARN] [WARN][Ext.Component#constructor] Registering a component with a id (`name`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`. How should i destroy it as the Warning suggest ? or how should i fix this ? UPDATE function onPersonFound(imageData) { var image = Ext.create('Ext.Img', { src: "data:image/jpeg;base64," + imageData, id: 'logo', width: 372, height: 140 }); [WARN][Ext.Component

Difference of Native packaging between Sencha touch2 and PhoneGap

走远了吗. 提交于 2019-11-30 11:58:34
What is the difference of native packaging between Sencha touch2 and PhoneGap? Many people use PhoneGap to natively package app based on Sencha touch, but I find that Sencha touch 2 has a new feature of native packaging. So which type of native package is better in Performance, scalability, functionality, maturity, etc. ? How do you choose? PhoneGap is a middle-platform which is able to access some native APIs on many platforms and its interface language is Javascript. This means that PhoneGap is able to work with many cross-platform mobile web frameworks, such as: Sencha Touch, Titanium,

Sencha Touch 2.3 / Cordova : Build run directly on device

南笙酒味 提交于 2019-11-30 09:09:59
问题 I created an app for android with Sencha Touch 2.3 and Cordova. I used the following command to build and run the apk: sencha app build -run native However, this runs the app on the emulator but I would like to directly run it on the usb connected android device. Is it possible? I already tried commands like these but it didn't work. sencha app build -device native or sencha app build -run -device native 回答1: It is possible. There is a difference between Sencha and Cordova commands and both

How to call functions within a XTemplate (itemTpl)

倾然丶 夕夏残阳落幕 提交于 2019-11-30 08:31:58
I would like to use Ext's String method on some text that will be output to the view. For example: itemTpl: [ ... '<tpl switch="post_type">', '<tpl case="new_user">', '<p>{post_text_teaser}</p>', '<p>{timestamp}</p>', '<tpl default>', '<p>' + Ext.String.ellipsis( + '{post_text_teaser}' + \, 4) + '</p>', ... ].join(''), but of course the concatenation in line 10 is illegal. Do you know if it's possible or how to do this correctly? This should solve your problem: '<tpl switch="post_type">', '<tpl case="new_user">', '<p>{post_text_teaser}</p>', '<p>{timestamp}</p>', '<tpl default>', '<p>{[Ext

Drawing Html tables on a Panel?

廉价感情. 提交于 2019-11-30 07:55:41
How can I generate a regular html <table> on a Panel in Sencha Touch 2? The data for each row could be from a store. It's not very "mobile" like a List, but I'd like to have a few detail Panels on my tablet app contain several sections like this: header #1 <table> <tr><td>one</td>td>two</td></tr> <tr><td>foo</td>td>bar</td></tr> </table> header #2 <table> <tr><td>abc</td>td>xyz</td></tr> <tr><td>cat</td>td>dog</td></tr> </table> The basic Panel definition should look something like this: Ext.define('Kitchensink.view.HtmlTable', { extend: 'Ext.tab.Panel', config: { activeItem: 1, tabBar: {