[CLOSED] InputMask Native not working with Ext. 4.5.1 (MVC version)

  1. #1

    [CLOSED] InputMask Native not working with Ext. 4.5.1 (MVC version)

    Hello,
    After migration from ext 2.5 to 4.5.1(MVC version) we observed that InputMask Native is not working.

    In Ext 2.5 below code:
     .Plugins(new InputMask
                                        {
                                            Mask = "99999?-9999"
                                        })
    In Ext 4.5.1 below code
     .Plugins(new InputMask
                                        {
                                            Mask = "99999?-9999"
                                        }) 
     .InputMask(Html.X().TextFieldInputMask().Pattern("99999?-9999"))
    We required to enter user to 5 digits. After question marks its optional as per above code.
    For E.g. 1. 12345 (allow) 2. 12345-67891 (allow) 3. 12345-67___ (not allow)
    As mentioned in example link(its for web forms) https://examples4.ext.net/#/Form/TextField/InputMask/
    same required for MVC version.
    UnMask() function also not working.
    Last edited by fabricio.murta; Aug 01, 2018 at 12:41 PM.
  2. #2
    Hello @MOHAMMEDRAFI!

    The native InputMask component is not accessed via the Plugins concept. This, and the example you linked, are Ext.NET's implementation of the InputMask, that have been introduced back in Ext.NET 2.

    The native InputMask implementation has its own documentation here: Documentation on Ext.field.InputMask for Ext JS 6.6.0.
    An example using the native InputMask implementation is just below the one you linked: Native InputMask example.

    So this affirmation:
    Quote Originally Posted by MOHAMMEDRAFI
    After migration from ext 2.5 to 4.5.1(MVC version) we observed that InputMask Native is not working.
    Is strange, as the component didn't even exist back in Ext.NET 2.5.

    Now, for your question, regarding the "optional" operator. The operator dictates that "from that point onwards" the sequence in that format is optional. That is, for "99999?-9999", it should accept none, part, or full text, as long as it follows the format, that is, accepted values would be:
    12734
    12934-1
    16234-21
    12733-329
    12832-2039
    This behavior is the same between Ext.NET 2 and Ext.NET 4 implementation of the functionality.

    For what I could understand, you want either the field to be filled with 23923 [/o]-or-[/i] 23923-8892, not allowing, for example 23923-88.

    Unfortunately, our implementation of InputMask does not support this, that would be like an "optional block", requiring -all- to be present if any been input. For this, I'm afraid you'd need to use an additional validation; you could enforce the length being either 5 or 10 (counting the '-' dash, it depends when and which field you check against to be 9 or 10, as it could or could not include the '-' by the mask). Or alternatively use a regexp field validation which, as the name suggests, gives you all the power of regular expressions matching while validating your field.

    This "optional" operator (?) is only present in Ext.NET's implementation of the InputMask. The Native Ext JS implementation of the input mask does not seem to support it at all, by its documentation linked above.

    I hope this helps!

    If you need help implementing the 2nd-layer validation, please let us know.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thank you. Issue has been resolved. You may close this thread.
  4. #4
    Glad it helped, thanks for the feedback!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Delete is not working in version 2
    By Binai in forum 2.x Help
    Replies: 0
    Last Post: Feb 15, 2017, 1:05 PM
  2. [CLOSED] Native App with Ext.Net Mobile
    By Zdenek in forum Mobile Help
    Replies: 9
    Last Post: Dec 26, 2016, 1:44 PM
  3. Replies: 0
    Last Post: Jul 31, 2015, 8:41 AM
  4. Replies: 1
    Last Post: Aug 07, 2012, 2:13 AM
  5. Replies: 1
    Last Post: May 20, 2011, 6:08 AM

Posting Permissions