|
PHP2Go Javascript Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--Mask
Defined in inputmask.js
| Field Summary | |
Array |
fields
Set of mask fields and literals |
| Constructor Summary | |
Mask
()
A mask is a set of definitions to restrict the contents and format required in a form field. |
|
| Method Summary | |
Boolean
|
accept(<String> chr, <Number> caretPos, <Number> selSize, <Number> maxLen)
Test if a char must be accepted by the mask, given the current caret position and the current field's selection size |
void
|
addField(<String> chars, <Number> min, <Number> max)
Adds a new field in the mask. |
void
|
addLiteral(<String> c, <Boolean> opt)
Adds a new literal in the mask. |
void
|
apply(<Object> fld)
Apply the mask by filtering (when the mask is a simple filter) or formatting (when the mask contains multiple fields and literals) |
<private> void
|
filter(<Object> field)
Filters the field value removing chars that don't respect the mask regular expression |
<private> void
|
format(<Object> field)
Iterates through all the field chars, validating them against the mask format. |
Number
|
getCaretPosition(<String> oldVal, <String> newVal, <Number> caret, <Number> key)
This method can be overriden to add caret position routines. |
Number
|
getMaxLength()
Calculate the maxlength of the mask |
Number
|
getMaxPosition(<Number> idx, <Number> max)
Return the highest available position inside a field, based on its index. |
Boolean
|
isComplete()
Verifies if the mask is complete |
Boolean
|
isOnlyFilter()
Verify if the mask is a simple regexp filter, without multiple fields or literals |
void
|
loadExpression(<String> expr)
Transforms a given expression into fields and literals. |
String
|
onAfterChange(<String> val)
Handler function called from inside Mask.format(). |
String
|
onBeforeChange(<String> val)
Handler function called from inside Mask.format(). |
void
|
onBlur(<Object> fld)
This method can be overriden to apply transformations or validations in the field's value when the blur event occurs |
Boolean
|
onKeyDown(<Object> fld, <Integer> caret, <Integer> key)
Handler function called from inside InputMask.keyDownHandler(). |
String
|
serialize()
Serialize the mask |
<static> Mask
|
fromExpression(<String> expr, d)
Build a new instance of the Mask class based on a given expression. |
<static> Mask
|
fromMaskName(<String> name)
Return a Mask object based on one of the mask names available to the PHP2Go form API: DIGIT, INTEGER, FLOAT, CURRENCY, DATE, ... |
| Field Detail |
Array fields
| Constructor Detail |
Mask()
| Method Detail |
Boolean accept(<String> chr, <Number> caretPos, <Number> selSize, <Number> maxLen)
chr - Typed char
caretPos - Current caret position
selSize - Current field's selection size
maxLen - Field's maxlength
void addField(<String> chars, <Number> min, <Number> max)
chars - Acceptable chars
min - Minimum size
max - Maximum size
void addLiteral(<String> c, <Boolean> opt)
c - Literal char
opt - Whether the literal is optional
void apply(<Object> fld)
fld - Field reference
<private> void filter(<Object> field)
field - Field reference
<private> void format(<Object> field)
field - Field reference
Number getCaretPosition(<String> oldVal, <String> newVal, <Number> caret, <Number> key)
oldVal - Field's old value
newVal - Field's new value
caret - Field's last caret position
key - Last typed key
Number getMaxLength()
Number getMaxPosition(<Number> idx, <Number> max)
idx - Field index
max - Form input maxlength
Boolean isComplete()
Boolean isOnlyFilter()
void loadExpression(<String> expr)
expr - Expression to be parsed
String onAfterChange(<String> val)
val - New input value
String onBeforeChange(<String> val)
val - Current input value
void onBlur(<Object> fld)
fld - Field reference
Boolean onKeyDown(<Object> fld, <Integer> caret, <Integer> key)
fld - Field reference
caret - Caret position
key - Last typed key
String serialize()
<static> Mask fromExpression(<String> expr, d)
expr - Mask expression
<static> Mask fromMaskName(<String> name)
name - Mask name
|
PHP2Go Javascript Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||