1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    66
    Vote Rating
    1
    Answers
    1
    stevanicus is an unknown quantity at this point

      0  

    Default Unanswered: selector for last form field

    Would be very grateful if anyone could tell me how to write the selector correctly so that I can access the specialkey event on the last field in a form.

    Thanks

    P.s. here is what I have in my controller so far:

    Code:
    'myformpanel [isFormField=true]:last-child':{
                            specialkey:function(){
                                console.info("hello hello");
                            }
                        }

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Vote Rating
    26
    Answers
    106
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default

    This worked for me using a sample form:

    Code:
    Ext.ComponentQuery.query('form field:last')[0]

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    66
    Vote Rating
    1
    Answers
    1
    stevanicus is an unknown quantity at this point

      0  

    Default

    thanks.... its works if you use the Component Query... but what if you use the controller query

    Code:
    init : function() {
    
    
    this.control({
    
         'myformpanel field:last':{
              focus:function(){
                   console.info("focus!");
              },
              specialkey:function(){
                   console.info("hello");
              }
         }
    });
    
    }
    then it doesn't work

  4. #4
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    66
    Vote Rating
    1
    Answers
    1
    stevanicus is an unknown quantity at this point

      0  

    Default

    *bump*

  5. #5
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Vote Rating
    26
    Answers
    106
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default

    You're right, this doesn't appear to work in the context of a Controller...

    I tried several permutations on the selector and still no luck.

  6. #6
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    66
    Vote Rating
    1
    Answers
    1
    stevanicus is an unknown quantity at this point

      0  

    Default

    I tried debugging the source code a little, filterByPseudo does return the correct component and the event and selector seem to register correctly but it seems as though the controller doesn't pick it up.


    P.s thanks for your reply

  7. #7
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    66
    Vote Rating
    1
    Answers
    1
    stevanicus is an unknown quantity at this point

      0  

    Default

    I've registered it as a bug with a workaround

    http://www.sencha.com/forum/showthre...792#post824792

Thread Participants: 1

Tags for this Thread