sencha-touch-2

How to destroy an inactive view in Sencha Touch

时光毁灭记忆、已成空白 提交于 2019-12-09 16:45:12
问题 i stuck with a problem which is really important i guess. In a simple Sencha Touch App I have many views. My Mainview is a TabPanel with docking icons in the bottom. Sometimes in my App I switch to another views which are outside of the Tabpanel. I don't want the DOM to overload with views, i don't need anymore so i'm searching for a solution to destroy a view, when its inactive. I've tried this, while switching into another view in my controller: this.getMainview().destroy(); It seems that

Animating dimensions in Sencha Touch 2

假装没事ソ 提交于 2019-12-09 13:25:20
问题 I'm trying to animate the height of a dataview, but it's currently just sliding the panel around the viewport instead of keeping it in place and changing it's height. The code is as follows: Ext.Anim.run(el, 'slide', { from: { height: height }, to: { height: newHeight }, out: false, direction: 'up', easing: 'ease-out', duration: 1000 }); For instance, height=200, newHeight=100 will result in the dataview dropping immediately so that it's top is at 200px below the viewport, and then animating

Sencha touch 2 : getting item index in itemTpl

落爺英雄遲暮 提交于 2019-12-09 06:54:25
问题 In the documentation of XTemplate, {#} can be used to get the current array index. When I use it in the itemTpl of an xlist, I always get 1 instead of the index: { xtype: 'list', store: 'myStore', itemTpl:new Ext.XTemplate( '<tpl for=".">', '<div>Item n°{#1}</div>', '</tpl>' ), } always produces "Item n°1" even if my store contains several items. Am I doing something wrong ? 回答1: Note that you're using a Ext.List which fetchs data from a Ext.data.Store , not an Array, so XTemplate processes

Button click in Android app using Sencha Touch 2 running fine on emulator but not working on Android Device

爱⌒轻易说出口 提交于 2019-12-09 04:41:25
Button click in Android app using Sencha Touch 2 running fine on emulator but create problem on Android Device. When I am click on button in emulator it shows correct alert message but when I am clicking on button in Device it shows nothing. It doesn't go inside if case. My code for button is as follows:- { xtype: 'button', text: 'Save', handler: function(){ val3 = Ext.getCmp('na').getValue(); console.log(val3); val = Ext.getCmp('ea').getValue(); console.log(val); val4 = val.indexOf("@"); console.log(val4); val5 = val.lastIndexOf("."); console.log(val5); val2 = Ext.getCmp('pa').getValue();

List data from json on Sencha

时间秒杀一切 提交于 2019-12-08 13:35:28
问题 i am trying to show data from webserver json and it is not shown in view. At first i tried to show message only but could not succed. following this link and sample provided by @rdougan i have been able to parse upto categories but unable parse latter value can any one guide me. code i have done till now are as follow: { xtype: 'panel', padding: '20px', //height: 100, styleHtmlContent:true, store: 'TodaysWordStore', models: 'TodaysWordModel', tpl: [ '<tpl for=".">', '<ul class="parabox">', '

How to add images for different screen resolutions in sencha touch?

青春壹個敷衍的年華 提交于 2019-12-08 12:41:00
问题 How can we add images i.e. in android such as small, medium, large and xlarge images in sencha touch as well as for IOS devices for normal display and Retina display? Is there any built in feature or helper function in sencha touch framework? 回答1: You can go with Implementation of Media Queries to do so. Check out below reference links. Media Queries to handle all device’s screens HTML5 Media Queries EDIT : If you need to target the Retina display separately, you can use this condition in

How can I open a URL in external browser using Phonegap+cordova in sencha touch app for ios?

扶醉桌前 提交于 2019-12-08 10:04:22
问题 I'm building a sencha touch app for ios. In order to open URL in external browser , I have included phonegap and cordova. I tried using both this functions to open URL.but didn't work.please help me. Ext.device.Device.openURL('http://www.bing.com'); navigator.app.openUrl('http://www.bing.com',{ openExternal:true }); 回答1: Simple window.open('http://www.google.com') should work and if you want to open the web page in a browser instance within your app, you should consider using InAppBrowser

Sencha 2.x MVC: Get element by id

我的梦境 提交于 2019-12-08 09:15:53
问题 I just started using Sencha framework 2.x. This is my app: app/app.js Ext.Loader.setConfig({ enabled: true }); Ext.application({ name: 'App', controllers: ['Generators'], models: [], stores: [], views: ['Main', 'Generator'], launch: function() { Ext.create('App.view.Main'); } }); app/view/Main.js Ext.define('App.view.Main', { extend: 'Ext.NavigationView', requires: [ 'App.view.Generator' ], config: { fullscreen: true, items: [ { xtype: 'generatorview' } ] } }); app/view/Generator.js Ext

datetimepicker is not working in chrome

懵懂的女人 提交于 2019-12-08 08:50:59
问题 i am using datetimepicker in sencha touch but its working in mozila and not working in chrome , have no idea why this is happening. I have downloaded from sencha market here is the source mozila ( its working ) chrome (not working ) UPDATE simple datepickerfield in chrome isnt working so basically there is some bug in sencha touch try this sample from official sencha touch and open it in chrome http://try.sencha.com/touch/2.2.0/docs/Ext.field.DatePicker.1/ 回答1: Its because of Chrome v43+, add

How to take a photo using Camera in Sencha App?

只谈情不闲聊 提交于 2019-12-08 08:24:23
问题 I am trying to take a picture using camera in Sencha Touch 2. Here i have one button 'Take a Picture', when i will press it, camera should start. As i am new to this sencha touch 2, i am unable to figure it out, how to do this? For this i used the below code: Sencha Fiddle Link Please help me. I do not want to use Phone gap. 回答1: You have to add device folder of Sencha Library in root directory and add below code in Ext.require('Ext.device.Camera'); and use this code for capture image using