-
4 Jun 2012 5:02 AM #1
Unanswered: selector for last form field
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"); } }
-
4 Jun 2012 11:09 AM #2
This worked for me using a sample form:
Code:Ext.ComponentQuery.query('form field:last')[0]
-
5 Jun 2012 1:02 AM #3
thanks.... its works if you use the Component Query... but what if you use the controller query
then it doesn't workCode:init : function() { this.control({ 'myformpanel field:last':{ focus:function(){ console.info("focus!"); }, specialkey:function(){ console.info("hello"); } } }); }
-
7 Jun 2012 7:15 AM #4
-
7 Jun 2012 9:27 AM #5
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.
-
7 Jun 2012 10:07 AM #6
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
-
8 Jun 2012 12:49 AM #7


Reply With Quote