sencha-architect

What is the use of initComponent function in extjs4.1?

痞子三分冷 提交于 2019-12-18 11:30:25
问题 Can anybody tell me what the use of the initComponent function is in extjs4.1? Please provide an example Thanks 回答1: This method is akin to a constructor for components. It is called by the true constructor , and is a really good hook point to customize the initialization of the component (as said in the name!). Except in some very rare occasions, you should override initComponent instead of the constructor because the more basic initialization will already have taken place. Most notably, the

sencha touch override ext.ajax

喜欢而已 提交于 2019-12-14 00:41:08
问题 I'm writing a sencha touch app using sencha architect. Because my app do lot of ajax request, most of it need to send 'token' in request header for authentication. So I think of create child class base on Ext.Ajax which always has 'token' in request header. Then I can use this child class without care of the header. MyApp.override.Ajax.request({ ... }) I try define this in app/override/Ajax.js Ext.define('Myapp.override.Ajax', { override: 'Ext.Ajax', headers: { 'token': 'test' } }); I also

Sencha Touch list doesn't load data in browser

蹲街弑〆低调 提交于 2019-12-13 21:24:31
问题 I have a really simple Sencha Touch 2.0.1 app made with Sencha Architect 2.0.0: a list of items loaded from a json file online (here). If I export it to an APK and install it on my droid, it displays perfectly. However if I try it on Chrome or Safari, they say 'Loading...' then display the word 'empty' where the list should be. I get this error in Firebug: GET http://listtest.webs.com/data.json?_dc=1344620739517&page=1&start=0&limit=25 x 166ms (where that 'x' is circled in red, meaning the

How to set url and root dynamically in extjs

半城伤御伤魂 提交于 2019-12-13 15:21:05
问题 Can anybody tell how to set the url and root of a store dynamically in Ext JS? I have created a store like the one below. I need to update the root and dynamically set the url inside a controller. Ext.define('Test.store.TestStore', { extend: 'Ext.data.Store', model: 'Test.model.TestModel', storeId: 'testStore', proxy: { type: 'jsonp', reader: { type: 'json', root: 'responseXML' } } }); Thanks 回答1: You can set the proxy's url later in your code this way: store.getProxy().url = '/your/url';

ExtJS - Adding headers to AJAX store

一笑奈何 提交于 2019-12-12 05:38:48
问题 Despite that I have configured the headers configuration of my store, getting an error like this: No 'Access-Control-Allow-Origin' header is present on the requested resource . Here is my proxy configuration of Ext.data.Store : proxy : { type : 'ajax', headers : { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, DELETE, PUT', 'Access-Control-Max-Age': '1000', 'Access-Control-Allow-Headers': 'x-requested-with, Content-Type, origin, authorization, accept,

Sencha CMD - Build Error: Mixed-Mode x-compile and microload markup is currently unsupported

无人久伴 提交于 2019-12-12 04:54:45
问题 Good day, I am trying to build my ExtJS 4.2 application and I am using Sencha Architect 3.1 and Sencha CMD 5.1.1.39 for the OSX. I was following this tutorial on how to build from the Terminal, and as expected, I got this error: com.sencha.exceptions.ExBuild: Mixed-Mode x-compile and microload markup is currently unsupported Upon googling, I came upon this thread from Sencha discussing how to get around this error. What I did next was to remove lines from my app.json file which originally

Get a particular value from Store in Sencha Touch?

为君一笑 提交于 2019-12-12 04:38:46
问题 I've created a model with following structure: Model Code: Ext.define('MyApp.model.FavoriteScreen', { extend: 'Ext.data.Model', config: { fields: [ { name: 'Name' }, { name: 'ScreenId' } ] } }); And I've created a store with following structure: Store code: Ext.define('MyApp.store.FavoriteStore', { extend: 'Ext.data.Store', requires: [ 'MyApp.model.FavoriteScreen' ], config: { autoLoad: true, model: 'MyApp.model.FavoriteScreen', storeId: 'FavStore', proxy: { type: 'ajax', api: { read: '/api

correct way to add js in sencha architect (ExtJS)?

蓝咒 提交于 2019-12-12 04:19:39
问题 This thread works well in a mobile app but in a desktop app it would seem I cant add the reference to the external JS in an extjs desktop app. The instructions from Sencha somehow don't correspond or it doesn't work for me when I try and follow them. So, I am selecting Resources->Library and can see the attribute Include JavaScript (ticked) and Library Base Path:/ext. The JS file I am using I use in a phone app and its fine - I added it to the app.json in that and compiling the app copies the

navigate to next view on image tap?

瘦欲@ 提交于 2019-12-12 02:54:33
问题 I am using dataview itemTpl to display my images (thumbnail view). I am able to display the images properly. How can I add itemtap on these images? So that when I tap on a particular image a new view is shown with the tapped image? I tried this with controller but no luck. Can you help me solving this. I am using Sencha Architect 2 for my example. I am trying this code .Please correct me First View Ext.define('MyApp.view.MyPanel', { extend: 'Ext.Panel', alias: 'widget.galleryview', config: {

Grid view data format in Sencha touch

*爱你&永不变心* 提交于 2019-12-12 02:53:58
问题 I want to display some data in gridview format in sencha touch but i'm not able to find any control or any other way to achieve this. I want my gridview should look like : Thanks in advance. 回答1: OMG, you're right, there's no grid component delivered with touch. You'll have to use this user extension: https://github.com/mitchellsimoens/Ext.ux.touch.grid. Mitchell Simoens works at Sencha, so I think you don't have to worry about the quality of this component. 来源: https://stackoverflow.com