I solved it like this:
Ext.define('ParentsApp.component.TextAreaAutomaticRow', { extend: 'Ext.form.Select', xtype: 'textareaautomaticrow', config: { maxRows: 2, autoHeight: true, listeners: { keyup: function (field, event) { if (field.autoHeight) { var numOfRows = field.getValue().split("\n").length; if( numOfRows >= 2) { numOfRows = numOfRows++; field.setMaxRows( numOfRows ); } else if (numOfRows < field.getMaxRows()) { field.setMaxRows( numOfRows + 1 ); } } } } },
});
source share