Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Events not detected in production build

  1. #21

    Default Location of where the widget is added seems to affect the production build

    Ext.define('apam.view.Main', {


    extend : 'Ext.Panel',


    xtype : 'mainpanel',


    config : {
    fullscreen : false,
    layout : 'hbox',
    padding : 40,
    items : [ Ext.create('Ext.Button', {

    flex : 1,
    text : 'Button',
    listeners : {
    tap : function() {
    alert('ehl');
    }
    }
    }) ]
    },

    log: function (msg) {
    console.log('apam.view.Main '+msg);
    },

    constructor: function (config) {
    this.log('constructor');
    config = config || {};

    Ext.apply(this.initialConfig, config);
    Ext.apply(this, config);

    // this.button = Ext.create('Ext.Button', {
    // flex : 1,
    // text : 'Button',
    // listeners : {
    // tap : function() {
    // alert('ehl');
    // }
    // }
    // });

    //apam.view.Main.superclass.constructor.apply(this, arguments);

    this.callParent(config);

    //this.add(this.button);
    }
    });


    Above script does not fire event when it is part of merged script.

    However the script in comment #18 continues to work in merged (production/testing) mode.

    this.callParent should be same as apam.view.Main.superclass.constructor.apply(this, arguments)

    The difference that seems to matter is how the button is added.

    In above script button is added at config.items whereas in comment #18 the button is added in constructor.

  2. #22
    Sencha Premium User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    628
    Answers
    67

    Default

    Show again source code.

    One thought: if you create a new application using the sdk tools, things are working fine or not?

  3. #23

    Default Source code is in comment #14, #15, #16, #17, #18

    The app was generated using the tool and I am concatanating it using the sencha app build tool..

    As I said, it works as long as the initialization of button is within constructor. This has resulted in some work, however I've got the prototype working again..

  4. #24
    Sencha Premium User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    628
    Answers
    67

    Default

    I am 99.99% sure you are massing things with overrides.
    I saw your previous code, I wanted to know how it looks after you used the right way on overrides this.callParent( arguments );


    The other question / advice was to create a new application to see if it works ok when you are not corrupting things around

  5. #25

    Default point out things incorrect in the source code

    I tried this.callParent(arguments) and it did not help.

    Can you please point out things that seem incorrect to you in the simplified code that I included in previous comments?

  6. #26
    Sencha Premium User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    628
    Answers
    67

    Default

    Did you create a new application just for testing?

Page 3 of 3 FirstFirst 123

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •