[CLOSED] How change height TextField

  1. #1

    [CLOSED] How change height TextField

    It is posible to modify the default textfiled heigth and the Font size?

    I can't do it with:


    X.Panel().Layout(LayoutType.HBox).Items(
             X.TextField().Height(20)
             ,
             X.TextField()
    )
    It is always 30px like the second TextField.
    why?
    Last edited by fabricio.murta; Jun 08, 2016 at 5:03 PM.
  2. #2
    Hello @grupoantolin! Welcome to Ext.NET forums!!

    The reason it does not work is because the text field is a complex element with a diversity of containers which height/width is controlled.

    If you want to fine tune the font size and height aspects of a specific text field, you can set via CSS, binding the inner field of the component to a css class to your liking.

    For example:
        <style type="text/css">
            .mybigfield {
                font-size: x-large;
                height: 100px
            }
        </style>
    And in your text field definition:

    X.TextField().FieldCls("mybigfield")
    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    It is not running properly.

    I use for CSS:
        
    <style type="text/css">
       .mySmallField {
           font-size: xx-small;
           height: 5px;
       }
    </style>
    And in the .cshtml
    X.Panel().Layout(LayoutType.HBox).Items(
             X.TextField().Text("small").FieldCls("mySmallField")
             ,
             X.TextField().Text("normal")
    )
    And the result is the same. Only a Font more smaller.
    The height of two TextField is the same. 30px.
    Attach Image:
    Click image for larger version. 

Name:	textfield_height.jpg 
Views:	27 
Size:	2.8 KB 
ID:	24627
    --------
    Last edited by grupoantolin; Jun 02, 2016 at 7:17 AM.
  4. #4
    Hello @grupoantolin!

    You have to continue styling the field with the CSS rules to make it fit. Like adjusting minimum line height, font height...
    Fabrício Murta
    Developer & Support Expert
  5. #5

    Solved!!

    Hi again.

    Finally i used the next css style:

    .mysmallfield{
        height: 10px;
        line-height: 10px;
        min-height: 20px;
        max-height:20px;
    }
    X.TextField().FieldCls("mysmallfield")
    Regards.
  6. #6
    That's it! Thanks for sharing the outcome!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. How change height TextField
    By sishco in forum 4.x Help
    Replies: 1
    Last Post: May 05, 2016, 3:50 PM
  2. [CLOSED] How change height TextField
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 11, 2011, 6:37 AM
  3. [CLOSED] is it possible to set height for textField
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 16, 2009, 3:16 PM
  4. Replies: 12
    Last Post: Jun 17, 2009, 12:07 PM
  5. TextField Height
    By Stefano in forum 1.x Help
    Replies: 0
    Last Post: Feb 03, 2009, 4:36 PM

Posting Permissions