Results 1 to 2 of 2

Thread: Ext.form.Text transformation

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2009
    Posts
    112

    Default Ext.form.Text transformation

    When User enters text (i.e. social security number) in Ext.form.Text, I want to partially mask the text with *. For example if User enters 000-000-0000, it will be displayed as ********0000.

    How do I do this so that getValue() still returns the original value?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    You can change setValue like:

    Code:
        setValue: function(value){
            this.value = value;
    
            if (this.rendered && this.fieldEl) {
                //doSomething can modify the value that is displayed
                this.fieldEl.dom.value = doSomething(value);
            }
    
            return this;
        },
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •