Results 1 to 2 of 2

Thread: Limit TextArea field Rows and Cols

  1. #1
    Touch Premium Member
    Join Date
    Nov 2011
    Location
    Massachusetts
    Posts
    43
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

Tags for this Thread

Posting Permissions

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