1. #1
    Sencha User treblereel's Avatar
    Join Date
    Mar 2010
    Location
    Moscow,Russia
    Posts
    67
    Vote Rating
    1
    treblereel is on a distinguished road

      0  

    Default Unanswered: length of GXT HtmlEditor

    Unanswered: length of GXT HtmlEditor


    Hi All,

    How i can set length (chars) of HtmlEditor? look like i missing somethings in the docs ...

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Location
    http://www.cheapswtorcredits.net/
    Posts
    1
    Vote Rating
    0
    swtor119 is on a distinguished road

      0  

    Default detail?

    detail?


    Can you say a little more detail ?
    Play the old republic,swtor credits sale
    play the game well,buy swtor credits

  3. #3
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    15
    Answers
    1
    Vote Rating
    0
    dariusjb is on a distinguished road

      0  

    Default


    You can't, HtmlEditor extends Field, But MaxLength is only starting with TextField

    So, you must write your own, and do like TextField, overriding the validateValue

    new HtmlEditor(){
    @Override
    protected boolean validateValue(String value) {
    boolean result = super.validateValue(value);
    if (!result) {
    return false;
    }

    //COPIED FROM TEXTFIELD
    int length = value.length();

    if (length > maxLength) {
    String error = "";
    if (getMessages().getMaxLengthText() == null) {
    error = GXT.MESSAGES.textField_maxLengthText(maxLength);
    } else {
    error = Format.substitute(getMessages().getMaxLengthText(), maxLength);
    }
    markInvalid(error);
    return false;
    }
    }
    };

  4. #4
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    15
    Answers
    1
    Vote Rating
    0
    dariusjb is on a distinguished road

      0  

    Default


    I forgot to tell:

    //MAKE YOUR OWN GETTER/SETTER for MaxLength
    private int maxLength;

Thread Participants: 2