sencha-touch-2

Sencha Touch Label - does it have a Tap Event?

隐身守侯 提交于 2019-12-06 02:20:26
问题 I'm trying to build a flashcard app with sencha touch 2. I have a label showing the question, which takes up the entire screen, I want it so that when the user taps on the label the answer shows. Does the label have a 'tap' event? It works when I use a button, but not when I use a label. Another way around is if I can get the button to be transparent on top of a label. Any suggestions? 回答1: You can do this : label.element.on({ tap : function(e, t) { ... } }); Hope this helps 回答2: one more way

how to call a function on a controller when Tapping on TabPanel? Sencha Touch 2

给你一囗甜甜゛ 提交于 2019-12-05 23:45:26
I have a controller and a TabPanel in Sencha Touch 2, I want to call a function when an element is tapped on the TabPanel: TabPanel.js Ext.define('app.view.principalTabPanel', { extend: 'Ext.tab.Panel', alias: 'widget.ptabpanel', config: { ui: 'light', items: [ { xtype: 'container', itemId: 'idContnr', title: 'tap Me!', iconCls: 'bookmarks' } ], tabBar: { docked: 'bottom', ui: 'light' } } }); controller.js Ext.define('app.controller.mainController', { extend: 'Ext.app.Controller', config: { control: { "ptabpanel #idContnr": { tap: 'takePhoto' } } }, takePhoto: function() { console.log('toma

Sencha Touch - Google Map and centering a Marker

跟風遠走 提交于 2019-12-05 21:49:01
Is it just me or does the google maps api seem to be on the quirky side? Trying to simply show a marker for some coordinates, and then center the screen on the marker. In my controller fired from a view: onGoogleMapRender: function (googleMap) { var long = record.get("Longitude"); var lat = record.get("Latitude"); var pos = new google.maps.LatLng(lat, long); var marker = new google.maps.Marker({ position: pos }); marker.setMap(googleMap); googleMap.setCenter(marker.getPosition()); googleMap.setZoom(14); } It seems to place the marker in the center of the screen but when I return and show the

Sencha Touch animation options

删除回忆录丶 提交于 2019-12-05 18:03:40
Where can I find a list of the available animation types for Ext.Panel.show()? I've searched the documentation and googled "sencha touch animation options", but can't find anything. You can see all the animations here http://dev.sencha.com/deploy/touch/examples/production/kitchensink/ And here's the API http://docs.sencha.com/touch/2-0/#!/api/Ext.anims Here is the documentation for the available animation types: http://docs.sencha.com/touch/2-0/#!/api/Ext.anims Some of them don't work on Android. In ST 2 cube * fade flip * pop slide wipe * *does not work in android Ext.Anim.run(this, 'fade', {

Sencha touch 2.4.0 SASS compile error

送分小仙女□ 提交于 2019-12-05 14:44:06
Environment: Mac OSX Mavericks 10.9.4 Compass 1.0.1 (Polaris) Compass-blueprint (1.0.0) Sass 3.4.5 (Selective Steve) sencha app build testing command no error When I compile app.scss file in the ./resources/sass/ directory, an error happened. compass compile app.scss error app.scss (Line 209 of /Users/icese7en/Sites/Demos/Sencha/Practice/WeatherApp/touch/resources/themes/stylesheets/sencha-touch/base/src/_Class.scss: File not found or cannot be read: /Users/icese7en/Sites/Demos/Sencha/Practice/WeatherApp/resources/sass/fonts/pictos/pictos-web.woff) File not found or cannot be read: /Users

Nested JSON from 3 one-to-many Tables

拟墨画扇 提交于 2019-12-05 11:52:18
I'm building a Sencha-Touch 2 app and I have some trouble with the recuperation of my data from server side (mysql DB). Here's my data model : Table1 : ID:int description:varchar(100) Table2 : ID:int description:varchar(100) table1_ID:int Table3 : ID:int name:varchar(100) info:varchar(100) table2_ID:int Table1 is join to Table2 with a one-to-many relationship and same between Table2 and Table3. What I want from server is a nested JSON who looks like this : [ Table1_object1_ID: 'id' : { Table1_object1_description: 'description', Table2_Objects : [ 'Table2_object1': { Table2_object1_id : 'id',

Sencha Touch list not displaying (again!)

青春壹個敷衍的年華 提交于 2019-12-05 09:38:50
My Sencha Touch list isn't displaying. All I did was change the root container to a navigation view so other views can be pushed onto it, but then the navigation doesn't like having 'fit' as the root. So I moved that into another container with type 'fit'. However, now the list doesn't display?! See below: Ext.define('MyApp.view.inbox.MyInbox', { extend: 'Ext.navigation.View', alias: 'widget.myinboxview', requires: [ 'Ext.navigation.View' ], config: { title: 'My Inbox', xtype: 'card', items: [ { xtype: 'container', type: 'vbox', items: [ { xtype: 'container', flex: 1, items: [ { xtype:

Why is there no sync callback in Sencha Touch?

谁说我不能喝 提交于 2019-12-05 09:29:48
I'd like to be able to show a message to the user once a store sync has successful completion. However, there doesn't seem to be any way of using a callback or calling this synchronously. I'm a little surprised this isn't provided out of the box as it must be a common problem. Is there any work-around for this? Zoltan Magyar It took us ages to find a proper solution to this. Finally we added listener to the store's write event what seems to be working properly. As it is needed frequently it has been added to the store prototype as Ext.data.Store.prototype.syncWithListener = function

SenchaTouch2.0 + socket.io : how to use socket.io.js in SenchTouch2.0

 ̄綄美尐妖づ 提交于 2019-12-05 09:04:11
问题 in fact, I had try it,and failed. now the code is: function include(path){ var a=document.createElement("script"); a.type = "text/javascript"; a.src=path; var head=document.getElementsByTagName("head")[0]; head.appendChild(a); } include("app/controller/node_modules/socket.io-client/dist/socket.io.js"); Ext.define('WGTalk.controller.guest', { extend: 'Ext.app.Controller', config:{ refs:{ viewMsg:'#viewMsg', txtMsg:'#txtMsg' }, control:{ '#btSend':{ tap:'doSend' } } }, launch:function(){ var

Sencha Touch 2: Insert into TreeStore/NestedList

若如初见. 提交于 2019-12-05 08:09:16
I'm using a NestedList with a underlying TreeStore. Now I want to add items to the NestedList as leafs. How can I do this? Currently my code (Controller, onAddButtonTapped) looks like this: var store = Ext.getStore('menuStore'); var customerAreaNode = store.getRoot().getChildAt(1); customerAreaNode.appendChild({name: "text", leaf:true}); customerAreaNode.expand(); store.sync(); This code results in two new empty listentries on leaf level (behind the correct node) and one new listentry on node level. Every new entry has no names shown in the NestedList but every item contains "text" in their