1. #1
    Touch Premium Member
    Join Date
    Nov 2011
    Location
    Massachusetts
    Posts
    43
    Vote Rating
    0
    martincf is on a distinguished road

      0  

    Default Unanswered: Limit TextArea field Rows and Cols

    Unanswered: Limit TextArea field Rows and Cols


    Is there any way to limit the TextArea by cols and rows?

    This post has something along the lines of what I'm looking for, but doesn't appear to be a valid function in Sencha Touch.
    http://www.sencha.com/forum/showthre...ws-in-textarea

    Is anyone aware of how you would limit the rows and columns?

    Martin

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Answers
    3447
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    There is a maxRows config on the TextArea field that will set the rows attribute to the textarea... for the cols, you will have to update the renderTpl:

    Code:
        renderTpl: [
            '<tpl if="label"><div class="x-form-label"><span>{label}</span></div></tpl>',
            '<tpl if="fieldEl"><div class="x-form-field-container">',
                '<textarea id="{inputId}" type="{type}" name="{name}" class="{fieldCls}"',
                '<tpl if="tabIndex">tabIndex="{tabIndex}" </tpl>',
                '<tpl if="placeHolder">placeholder="{placeHolder}" </tpl>',
                '<tpl if="style">style="{style}" </tpl>',
                '<tpl if="maxRows != undefined">rows="{maxRows}" </tpl>',
                '<tpl if="maxCols != undefined">cols="{maxCols}" </tpl>',
                '<tpl if="maxlength">maxlength="{maxlength}" </tpl>',
                '<tpl if="autoComplete">autocomplete="{autoComplete}" </tpl>',
                '<tpl if="autoCapitalize">autocapitalize="{autoCapitalize}" </tpl>',
                '<tpl if="autoFocus">autofocus="{autoFocus}" </tpl>',
                '></textarea>',
                '<tpl if="useMask"><div class="x-field-mask"></div></tpl>',
            '</div></tpl>'
        ]
    See what happens with that. Never messed with this... usually let the form do the sizing and I haven't had to limit the TextArea.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread