May 12, 2014, 6:21 PM
[CLOSED] [#488] [#499] Can't create a Field with mask Disabled
In 2013, i posted a thread regarding remove TextField's InputMask: http://forums.ext.net/showthread.php...d-s-Input-Mask
The given solution was enabling / disabling the InputMask.
But at this moment i am trying to add a disabled InputMask, with no initial mask, as shown below:
It's possible to overcome this issue by doing the following:
In my opinion, the InputMask should not try to call setMask, since it is disabled. Going further, it should not throw an error when the mask is set to undefined, since it's trying to access a member of a null instance (should evaluate whether the mask is null).
Thanks in advance
The given solution was enabling / disabling the InputMask.
But at this moment i am trying to add a disabled InputMask, with no initial mask, as shown below:
<ext:TextField ID="TextField1" runat="server">
<Plugins>
<ext:InputMask ID="Mask1" runat="server" Mask="" Enabled="false" />
</Plugins>
</ext:TextField>
By doing so, i get the following error:It's possible to overcome this issue by doing the following:
<script type="text/javascript">
Ext.net.InputMask.override({
setMask: function (mask) {
debugger;
if (arguments[0] == undefined) {
arguments[0] = "";
}
this.callParent(arguments);
}
});
</script>
The code above sets the mask to "" when it equals undefined.In my opinion, the InputMask should not try to call setMask, since it is disabled. Going further, it should not throw an error when the mask is set to undefined, since it's trying to access a member of a null instance (should evaluate whether the mask is null).
Thanks in advance
Last edited by Daniil; Sep 29, 2014 at 2:41 PM.
Reason: [CLOSED]