1. #1
    Ext User
    Join Date
    Aug 2008
    Posts
    30
    Vote Rating
    0
    freez is on a distinguished road

      0  

    Default Changing TextField Width..please help

    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 - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      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
    freez is on a distinguished road

      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
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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
    freez is on a distinguished road

      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
    santosh.rajan is on a distinguished road

      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
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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
    freez is on a distinguished road

      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
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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
    freez is on a distinguished road

      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