GXT3 Input Maxlength

I just migrated from GXT2 to GXT3.
Most of my previous code does not work and I got a problem to fix MAXLENGTH input element.
Luckily, the solution is very simple. Here is the code

textbox.getCell().getInputElement(textbox.getElement()).setMaxLength(maxLength);

This code worked for TextField, TextArea, NumberField<Integer> and NumberField<Double>.

But for NumberField, this syntax must be applied after the value has been set. If not, the maxlength attaribute will be removed.

Source : http://www.sencha.com/forum/showthread.php?178262-Setting-max-length-on-TextField

0 comments:

 
Copyright © peyotest