2

Check this fiddle. How can we limit numbers of lines that is allowed to enter in ExtJS TextArea. Does ExtJs provides something out of the box or I have to reply on some cusotm function as shown in this link

I am using ExtJs 4.1

Ext.onReady(function () {
    Ext.create('Ext.window.Window', {
        height: 60,
        layout: 'anchor',
        minHeight: 60,
        width: 200,
        items: [{

            grow: true,
            anchor: '100%',
            flex: 1,
            xtype: 'textareafield'
        }]
    }).show();
});
Community
  • 1
  • 1
SharpCoder
  • 18,279
  • 43
  • 153
  • 249

1 Answers1

0

You can use maxLength along with enforceMaxLength property:

Ext.onReady(function () {
    Ext.create('Ext.window.Window', {
        height: 60,
        layout: 'anchor',
        minHeight: 60,
        width: 200,
        items: [{
            grow: true,
            anchor: '100%',
            flex: 1,
            xtype: 'textareafield',
            maxLength: 5, // 5 is only used for demo purpose
            enforceMaxLength: true
        }]
    }).show();
});

Updated Fiddle

Felix
  • 37,892
  • 8
  • 43
  • 55