Apr 03, 2015, 12:45 AM
[CLOSED] PasswordMask override issue
I have a js file that defines all of the Ext.Net overrides (bugs and enhancements) and I include it within my MasterPage.aspx. Everything works fine until I call a page that does not use the plugin PasswordMask. The following javascript error occurs
Do I need to pull this override out and only call it when needed?
Below is an example with the latest override from Thread 58011, but I commented out the Plugin.
Uncaught TypeError: Cannot read property 'override' of undefined
Do I need to pull this override out and only call it when needed?
Below is an example with the latest override from Thread 58011, but I commented out the Plugin.
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<script runat="server">
</script>
<head runat="server">
<title></title>
<style type="text/css">
</style>
<script type="text/javascript">
Ext.net.PasswordMask.override({
renderHiddenField: function () {
var field = this.getCmp();
if (field.ownerCt) {
field.ownerCt.items.add(this.hiddenField);
} else {
this.hiddenField.render(field.el.parent());
}
field.inputEl.on("keydown", this.onKeyDown, this);
},
onKeyDown: function (e) {
var me = this,
oldValue = me.cmp.lastValue || "";
if (me.mode != "hideall") {
return;
}
setTimeout(function () {
var newValue = me.cmp.getValue(),
key = e.getKey();
if ((newValue.length < oldValue.length) && ((key === e.BACKSPACE) || (key === e.DELETE))) {
me.onDelete(me.getCaretRange(), oldValue.length - newValue.length);
} else {
me.maskChars(newValue);
}
me._maskAll();
}, 0);
}
});
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Panel runat="server" Title="Password Mask Issue" Margin="5" Height="200" Width="400" BodyPadding="10" UI="Danger">
<Items>
<ext:TextField ID="Password" runat="server" FieldLabel="Password" ClientIDMode="Static" SelectOnFocus="true">
<%--<Plugins>
<ext:PasswordMask runat="server" Mode="HideAll" Pattern="z" AllowAnyChars="true" />
</Plugins>--%>
</ext:TextField>
</Items>
<Buttons>
<ext:Button runat="server" Text="Login" Handler="Ext.Msg.alert('Password ...', App.Password.getPassword());" />
</Buttons>
</ext:Panel>
</body>
</html>
Last edited by Daniil; Apr 06, 2015 at 9:18 AM.
Reason: [CLOSED]