Results 1 to 3 of 3

Thread: Why doesn't anchor:100% expand a textarea field inside a FieldContainer inside a Form

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2010
    Location
    Vancouver, Canada
    Posts
    239
    Answers
    3
    Vote Rating
    71
      0  

    Default Answered: Why doesn't anchor:100% expand a textarea field inside a FieldContainer inside a Form

    Here is the fiddle to try it: https://fiddle.sencha.com/#view/editor&fiddle/2lf5/


    Here is the code from the fiddle:


    Code:
    Ext.application({
        name: 'Fiddle',
    
    
        launch: function () {
            Ext.define('App.view.SomeForm', {
                extend: 'Ext.form.FieldContainer',
                alias: 'widget.someform',
    
    
                requires: [
                    'Ext.form.Label',
                    'Ext.form.RadioGroup',
                    'Ext.form.field.Radio',
                    'Ext.form.field.Text',
                    'Ext.form.field.TextArea',
                    'Ext.form.field.Number',
                    'Ext.form.field.Date'
                ],
    
    
    
    
                layout: 'vbox',
                items: [{
                    xtype: 'textareafield',
                    anchor: '100%',
                    height: 85,
                    //width: 500,
                    resizeHandles: 'se',
                    fieldLabel: 'If No, explain',
                    enforceMaxLength: true,
                    maxLength: 255,
                }]
    
    
            });
    
    
            new Ext.form.Panel({
                renderTo: document.body,
                items: [{
                    xtype: 'someform',
                    anchor: '100%',
                    height: 85
                }, {
                    xtype: 'textfield', fieldLabel: 'SomeLabel', anchor: '100%'
                }]
            });
        }
    });
    The textfield is expanded horizontally but the textarea is not. A textfield inside the fieldcontainer doesn't expand horizontally either. I am not sure why the fields inside the container do not to expanding horizontally.

    Any suggestions on how to fix it?


    Thanks

  2. Anchor is only valid when the container has an anchor layout. Also, in that particular case, anchor only refers to the width.

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,128
    Answers
    739
    Vote Rating
    976
      0  

    Default

    Anchor is only valid when the container has an anchor layout. Also, in that particular case, anchor only refers to the width.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha Premium Member
    Join Date
    Jan 2010
    Location
    Vancouver, Canada
    Posts
    239
    Answers
    3
    Vote Rating
    71
      0  

    Default

    Thanks, changing the layout to anchor did the trick. Somehow I thought fieldcontainer behaves like a form panel by default.

Similar Threads

  1. Can't drag Ext.resizer.Spliter inside Ext.form.FieldContainer
    By kobayashi.masashi in forum Ext 6: Bugs
    Replies: 1
    Last Post: 15 Sep 2016, 3:45 PM
  2. Replies: 1
    Last Post: 21 Jun 2011, 7:16 AM
  3. grid inside tabpanel inside form iinside window doesn't appear
    By senacle in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 5 Jun 2011, 7:33 AM
  4. grid doesn't size correctly inside tabpanel inside panel
    By pflammer in forum Ext 2.x: Help & Discussion
    Replies: 15
    Last Post: 5 Jan 2009, 12:00 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
  •