Results 1 to 2 of 2

Thread: dynamic add fields how to adjust layout?

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    10
    Vote Rating
    0
      0  

    Default dynamic add fields how to adjust layout?

    var formPanel = Ext.getCmp('yourForm');
    //add
    formPanel.add(
    {
    xtype : 'textfield',
    fieldLabel : 'Extra Field',
    name : 'yourName',
    id : 'yourName'
    }
    )
    containerWindow.doLayout();


    //remove

    formPanel.remove(Ext.getCmp('yourName'));

    using above method,it can dynamically add the field,i wanna add the field behind the exsiting field, however not dynamically adjust the layout, attache demo.zipthe demo,plz
    help,thx.
    Last edited by jinjianhe; 22 Dec 2011 at 3:18 AM. Reason: fix

  2. #2
    Sencha - Community Support Team mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,023
    Answers
    3976
    Vote Rating
    1334
      0  

    Default

    If you want to insert a field at a specific index, use the insert method instead of the add method
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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