-
4 Jan 2008 8:15 AM #21
Thanks for the question that has revealed a bug in the code. Take the latest version in the first post and for a control over the number of characters you can do this:
Example 1 - 3 numeric values:
new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('999', true)]});
Example 2 - 4 alphanumeric values:
new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('AAAA', true)]});
Example 3 - 2 character (all kinds):
new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('X.XX.X', true)]});
-
4 Jan 2008 12:00 PM #22
Ok, but what if I want to limit to say 20/40/100 characters ... maybe there could be a config option for this. It would probably be easy to add so I may be posting again with an update.
other things -
In your (new) code, I think this is not used:
Ext.namespace('Ext.ux.netbox');
In my code, I'm using Ext's way to prototype (just thought I'd share I know there's no real difference):
// Add escape prototype feature to RegExp object
Ext.applyIf(RegExp, {
/**
* extend RegExp class with a escape method
* @return {String} An escaped string.
*/
escape : function(str) {
return new String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
}
});
-
7 Jan 2008 6:18 AM #23
Ok, but what if I want to limit to say 20/40/100 characters ... maybe there could be a config option for this. It would probably be easy to add so I may be posting again with an update.
I'm not sure I'm following you....
Is this a problem of expressing a mask with less characters?
For example for a number of exactly 10 digits you now write:
What do you want to write instead? I'm open for suggestionsHTML Code:new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('9999999999', true)]});
-
7 Jan 2008 2:09 PM #24
I decided this wasn't the best plug-in for that purpose

The problem is that maxlength is not being set in the html by Ext, even thought there is a maxLength in Ext. Ext allows any number of characters regardless of this setting, the only thing Ext does is mark the field as invalid if the characters exceed the threshold.
The preferred behavior would be for no input beyond the maxLength.
Maybe a separate plug-in would be better, or some Ext override. Haven't had much time to explore this.
PS ... my preferred syntax would be :
PHP Code:new Ext.ux.InputTextMask({
mask:'9999999999',
clearInvalid:true
})
-
7 Jan 2008 3:11 PM #25
JIC: This config fixes my issue:
PHP Code:autoCreate : {tag: "input", type: "text", size: "20", maxlength:20, autocomplete: "off"}
-
17 Jan 2008 3:01 AM #26
bug?
bug?
I encountered a bug with this mask : X[0|1]X9:99 X[a|p]Xm
I fixed this by resetting regexp to '', not null :
Code:for(var i=0; i<mask.length; i++){ if(regexp){ if(regexp == 'X'){ regexp = ''; } if(mask.charAt(i) == 'X'){ this.maskArray[mai] = regexp; mai++; regexp = ''; // <= RIGHT HERE ! } else { regexp += mask.charAt(i); } } ...snip... }
-
18 Jan 2008 1:39 AM #27
-
21 Jan 2008 4:59 PM #28
in opera 9.25 for windows xp if you use the "backspace" or "delete" for clear your input.. the mask fail..
-
22 Jan 2008 4:27 AM #29
-
22 Jan 2008 5:46 AM #30
Opera is not supported at the moment...
Opera is not supported at the moment...
Yes, I know...
The problem is that we don't support Opera at the moment (we don't need it, we are a bit short with our roadmaps and with Opera some events (such the Backspace and the Delete) are not easyly stoppable...).
We will support Opera when we will find the time to look at the problem...
All the patches are welcome...



Reply With Quote

