Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Changing TextField Width..please help

  1. #1
    Ext User
    Join Date
    Aug 2008
    Posts
    30
    Vote Rating
    0
      0  

    Default Changing TextField Width..please help

    Hi all,


    I have made a textfield on the toptool bar of the window

    var Box = new Ext.form.TextField({
    id: UrlBoxId,
    value: 'Enter',
    grow: true,
    selectOnFocus: true,
    growMin: 100,

    But while resizing the window, since there is no growmax: ,the textfield goes outside the window. how can i give a floating growmax: so that it changes as per the window size?????

    please help me

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    86
      0  

    Default

    have you tried growMax? I don't see it in your code

  3. #3
    Ext User
    Join Date
    Aug 2008
    Posts
    30
    Vote Rating
    0
      0  

    Default

    Thanks for your reply.


    I have given growMax:300.

    but problem occurs when we resize the window size and window width goes below 300.

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    Does it really have to grow? Can't you just set an anchor to make it always fill the remaining space?

  5. #5
    Ext User
    Join Date
    Aug 2008
    Posts
    30
    Vote Rating
    0
      0  

    Default

    Hi,
    If it grows it will be good. but if its not possible have to go for your idea.
    Can you explain me without growing how can i do that?

  6. #6
    Ext User santosh.rajan's Avatar
    Join Date
    Sep 2007
    Location
    Kannur, Kerala, India
    Posts
    611
    Vote Rating
    0
      0  

    Default

    put it inside a formpanel and set anchor to 100%
    Make everything as simple as possible, but not simpler.
    - Albert Einstein

  7. #7
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    Actually use:
    Code:
    anchor: '1 1'
    (both horizontal and vertical)

    In some cases you need to do something like:
    Code:
    anchor: '-2 -150'
    (to account for buttons or bottom toolbars)

  8. #8
    Ext User
    Join Date
    Aug 2008
    Posts
    30
    Vote Rating
    0
      0  

    Default

    Hi ,

    Sorry I couldnt get u...
    Can you please show me some sample code???

  9. #9
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    Example:

    Code:
    var win = new Ext.Window({
      ...
      layout: 'anchor',
      items: [{
        xtype: 'textfield',
        value: 'Enter',
        selectOnFocus: true,
        anchor: '1'
      }]
    });

  10. #10
    Ext User
    Join Date
    Aug 2008
    Posts
    30
    Vote Rating
    0
      0  

    Default

    Thanks for your reply

    But its not working.
    I made width:300
    and given anchor 100% but
    when i resizes window in such a way that window width < 300,
    the width of the textbox not resizes but ir breaks

Page 1 of 2 12 LastLast

Posting Permissions

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