• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Upgrade from 4.1 to 5.2 front end issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrade from 4.1 to 5.2 front end issues

    I use to code trigger on a textfield as follows. The fireEvent would fire an event in a controller. Now it does nothing. After hours of searching for an answer and experimenting, I surrender.

    Code:
    {
                        xtype: 'textfield',
                        anchor: '100%',
                        hidden: true,
                        itemId: 'searchform_acct',
                        fieldLabel: 'Account',
                        name: 'acct',
                        enforceMaxLength: true,
                        maxLength: 4,
                        regex: /[0-9]/,
                        triggers: {
                            mytrigger1: {
                                handler: function() {
                                    this.fireEvent('acctsearch');
                                },
                                cls: 'x-form-search-trigger'
                            }
                        }
                    }

    I tried a variety of things including using the ViewController but nothing ever happens. I can't seem to figure out the right combination.






  • #2
    Hi Mike,

    Is your controller listening for the event 'acctsearch' off the textfield with the item id of 'searchform_acct'? The scope of "this" within the handler should be the textfield.

    Thanks

    Comment


    • #3

      Try adding scope: this property to mytrigger1:
      Code:
      triggers: {    
         mytrigger1: {      
             scope  : this,       
             handler: function() {          
                 this.fireEvent('acctsearch');      
              },      
              cls: 'x-form-search-trigger'  
          }
      }

      Comment


      • #4
        Mystery solved. It was a combo of your two responses (sorta). In Architect there is an option to make it work. Right click on the field and select Global Controller/Add Action. The trick is instead of choosing from the list of events in the pull down, I had to just type in the name I put in the handler. The viola! Magic.

        Comment

        Working...
        X