Results 1 to 3 of 3

Thread: Click event handler problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Dec 2012
    Vote Rating

    Default Answered: Click event handler problem


    I am considering if it's possible to call setActiveItem from button's click event handler. I'm using Sencha Architect, I've tried several methods, but without luck. I was trying to run the code:

    onMenuitemClick: function(item, e, options) {
         //alert('Item clicked!'); //thats working
      Ext.getCmp('MyForm') ; //return undefined
    I would be very grateful for any help.

  2. ok
    Ext.getCmp(...) searches for a component with the matching config id.
    Does your form have an id of "myForm".
    I suspect not.

    What is better practice is to set an itemId on your form and use the button "up" method to find the form.
    See -!/...tton-method-up

    Now this is using a component query relative to the button looking up. See Ext.ComponentQuery in the API for details around query selectors (you could use Ext.ComponentQuery singleton to find the form as well).!/...ComponentQuery

    Assumming you give your form the itemid of "baseForm" your button query would look like.


    Good luck

Posting Permissions

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