1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default 'Change' event not firing for ComboBox via Architect

    'Change' event not firing for ComboBox via Architect


    Hi All,

    I have a very small project that I'm using the evaluate the new Architect as a replacement for Designer. I'm liking what I see so far, seems like a great update.

    I dropped a form panel on the canvas, then I added a combo box. I'm filling the combo box with a json store set to autoLoad using a model.

    In Architect, I've created a 'Change' event on my combo box. The name is: change, the fn is: onStatusTypeIdChange. Inside of my custom event edit via Architect is a simple console.log('foo'). When I deploy this app I do not see my log printed when I change values in the drop-down. If I update the event to 'afterrender', my log output is printed appropriately after the render, so I know the basic layout is functioning, I just need to understand why the 'change' event wont fire.

    Am I missing something obvious here? Did I configure something incorrectly?

    Here is the relevant code with the 'change' event.

    Code:
    Ext.define('MyApp.view.MyForm', {
        extend: 'Ext.form.Panel',
    
    
        height: 760,
        width: 916,
        layout: {
            type: 'auto'
        },
        bodyPadding: 10,
        title: 'My Form',
    
    
        initComponent: function() {
            var me = this;
    
    
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'combobox',
                        id: 'statusTypeId',
                        fieldLabel: 'Status',
                        displayField: 'displayName',
                        forceSelection: true,
                        queryMode: 'local',
                        store: 'MyJsonStore',
                        typeAhead: true,
                        valueField: 'statusTypeId',
                        listeners: {
                            change: {
                                fn: me.onStatusTypeIdChange,
                                scope: me
                            }
                        }
                    }
                ]
            });
    
    
            me.callParent(arguments);
        },
    
    
        onStatusTypeIdChange: function(field, newValue, oldValue, options) {
            console.log('foo');
        }
    
    
    });
    Thanks much,
    Thantous

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default bump

    bump


    bump in the hopes of finding a solution

    Thanks much,
    Thantous

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    See if the attached project helps. Your code looks fine. Its hard to tell without looking at entire project whats missing.
    Attached Files
    Bharat Nagwani
    Sencha Designer Development Team

  4. #4
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default


    Quote Originally Posted by bharatn View Post
    See if the attached project helps. Your code looks fine. Its hard to tell without looking at entire project whats missing.
    Thank you for the reply Bharat. I have downloaded and deployed your project. When I opened it, Architect alerted me that it had been created in a previous version and needed to be updated.

    Once deployed the 'change' event worked, so that's progress.

    I have attached my project in the hopes that it might shed light on what I've done incorrectly. Any input would be appreciated.

    thantous.zip

    Thantous
    Last edited by thantous; 30 Apr 2012 at 3:46 PM. Reason: Fixing previous posters name ;)

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    Model has field=statusTypeid and combo has valueField=statusTypeId. Needs to match.
    Bharat Nagwani
    Sencha Designer Development Team

  6. #6
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default


    Quote Originally Posted by bharatn View Post
    Model has field=statusTypeid and combo has valueField=statusTypeId. Needs to match.
    Ugh! Thanks for pointing that out, once updated it works perfectly.

Thread Participants: 1