0

ExtJs TextArea has maxLength property. When maxLength property is used with enforceMaxLength property it restrict the maximum number of characters that can be entered into the field.

If I set maxLength property to 5 and enforceMaxLength to true, user is only allowed to enter 5 character. Even when you paste some string which is greater than 5 characters, text-area only allows 5 character and remaining characters are ignored.

Since we can see the CodeBase of ExtJS, I want to see the code, which does not allow user to enter more than 5 character in the scenario I explained earlier.

I looked at this link and clicked on view source which opened this page but I am not able to figure out what code is getting executed for the above scenario.

I am more interested in learning how to trace back to the code which gets executed when user paste or type some text in ExtJs textarea.

I am using ExtJs 4.1. Feel free to provide your feedback if the question does not make sense

SharpCoder
  • 18,279
  • 43
  • 153
  • 249
  • I've never tried to look inside maxLengthText propetry, but I've made a similar thing with the datepicker component; I was interesting to get know how to component works across the user interaction. I've examinated ext-all-dev.js file to investigate how the framework operates. – Marco May 15 '14 at 13:27
  • 1
    It sets the maxLength property on the underlying `textarea`. Most modern browsers support it. For those that don't it attempts catch the paste event and do other stuff. – Evan Trimboli May 15 '14 at 13:27
  • @EvanTrimboli: I am interested in seeing the code under paste event. How can i see it? I have tried using FireBug with profile option but no luck so far :( – SharpCoder May 15 '14 at 13:30
  • `grep` the code for paste, you'll find it. – Evan Trimboli May 15 '14 at 13:40
  • @EvanTrimboli: Can you please tell me in detail how to grep the code. – SharpCoder May 15 '14 at 13:41
  • Linux and OS X have command-line `grep` command, you can get info on how to use it by typing `man grep`. For windows, see this discusson: http://stackoverflow.com/questions/87350/what-are-good-grep-tools-for-windows – Saki May 16 '14 at 12:48

0 Answers0