[CLOSED] Remove "MaskRe"

  1. #1

    [CLOSED] Remove "MaskRe"

    How to remove "MaskRe" property from a control after i've set it (let's say, [0-9])? I've tried setting null and String.Empty, but it throws errors.
    The only way i managed to remove it was setting another regular expression to make it allow any value.. But is there a better way to remove it?
    Last edited by Daniil; Nov 11, 2014 at 5:41 PM. Reason: [CLOSED]
  2. #2
    Hi @josegarcia,

    Please look at how maskRe works.
    http://docs.sencha.com/extjs/3.4.0/s...hod-initEvents

    if (this.maskRe || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Ext.form.VTypes[this.vtype + 'Mask']))) {
        this.mon(this.el, 'keypress', this.filterKeys, this);
    }
    So, it attaches the keypress handler.

    The fitlerKeys uses .maskRe and it cannot be null.

    So, your solution is good or you can detach the keypress handler.

    Also you can override the filterKeys function. Please use any approach that you think is better to you.

    It turns out there is no an API method to change a maskRe on the fly.

Similar Threads

  1. Replies: 6
    Last Post: May 31, 2013, 3:04 AM
  2. Replies: 3
    Last Post: Feb 27, 2013, 5:14 PM
  3. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  4. Replies: 2
    Last Post: Jan 24, 2012, 1:12 PM
  5. [CLOSED] remove "Page" text in paging toolbar
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 22, 2011, 6:07 AM

Posting Permissions