Question

I have a sencha touch 2 app which is working flawlessly without deployment. However, when I deploy to either testing, production or native, I have several buttons inside a navigation view with tap events which won't work anymore. No errors are shown. I cannot understand why this is happening only after deployment.

Here is the relevant code:

Controller:

control: {

        '#main-function': {
            tap: 'loadFunction'
         },


         loadMyBoat: function() {
              this.getProducts().up().push({
          xtype: 'myxtype',
         })



         Ext.getStore('Items').getProxy().setUrl('myurl');
         Ext.getStore('Items').load();
},

View:

Ext.define('MyBoat.view.ItemList', {
extend: 'Ext.navigation.View',
xtype: 'myxtype',

config: {
    title: 'My Title',
    styleHtmlContent: true,
    defaultBackButtonText: 'Items List',

    items: {
        xtype: 'list',
        itemTpl: '{Field_Name}',


        title: 'Tap on a boat to access further details',
        store: 'Boats'
    }
}
})

Anyone ever encountered this? Any help would be greatly appreciated.

Was it helpful?

Solution 2

After lots of debugging I managed to fix the problem. Turns out that using the following code to generate any component will not work well after deployment:

new Ext.button({.....})

Instead you have to use xtypes rather than the new keyword. I think this has something to do with the fact that the deployer stores all the js code in one file and thus since I was using the new keyword, it was being created somewhere in the js file when it actually won't exist in the context. The weird thing is that it does not show any errors so hopefully this will help other folks.

OTHER TIPS

Open up your DOM editor (in chrome, F12 I believe). Your control selector is selecting #main-function, so you'll want to make sure this is a valid selector.

On the console of your developer tools window, type:

Ext.ComponentQuery.query('#main-function')

This should be what the controller is trying.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top