Results 1 to 6 of 6

Thread: how to give default focus in textfield of the Form Panel

  1. #1
    Sencha User
    Join Date
    Feb 2010
    Location
    St. Louis
    Posts
    19

    Default how to give default focus in textfield of the Form Panel

    Hi,

    This is very urgent anyone have answer...

    I have extend the numberField class like this Ext.extend(Ext.form.NumberField,

    and used in the form panel as an item

    for example


    xtype:
    'x-clfw-cldecimalfield'


    and this is editable numberfield



    Problem:



    I want when this form panel load it should get first focus on this numberfield which is 3rd items of the form panel



    anyone have answer how to give default focus on any numberfield or textfield



    Thanks,





  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Code:
    formPanel.on('afterlayout', function(){
      myField.focus();
    }, null, {single: true});
    (or is this form part of a window?)

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Location
    St. Louis
    Posts
    19

    Default

    Thanks condor

    yes this form is part of window
    i have add this form in the window popup class and this open when we double click on gird row.

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    If the form is part of a window then you should simply configure your window with:
    Code:
    defaultButton: 'id-of-field'

  5. #5
    Sencha User
    Join Date
    Feb 2010
    Location
    St. Louis
    Posts
    19

    Default

    form panel is part of window.. and and numberfield which i have to give set focus is a a part ofr form panel

    so what u are finally sugguesting
    this code will work

    formPanel.on('afterlayout', function(){
    myField.focus();
    }, null, {single: true});

  6. #6
    Sencha User
    Join Date
    Feb 2010
    Location
    St. Louis
    Posts
    19

    Default

    Thanks condor

    defaultButton confirm work in window to give focus

Similar Threads

  1. Setting default focus on form field
    By hiral in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 7 Apr 2010, 2:17 AM
  2. How to change default emailText using vtype in form.TextField
    By medusadelft in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 21 Jul 2007, 1:55 PM
  3. Replies: 4
    Last Post: 17 May 2007, 6:03 AM
  4. How to give spacing between Label and TextField in Form ?
    By saasira in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 12 Mar 2007, 10:35 PM

Posting Permissions

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