123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- if(!dojo._hasResource["dijit.form.CurrencyTextBox"]){
- dojo._hasResource["dijit.form.CurrencyTextBox"] = true;
- dojo.provide("dijit.form.CurrencyTextBox");
- dojo.require("dojo.currency");
- dojo.require("dijit.form.NumberTextBox");
- dojo.declare(
- "dijit.form.CurrencyTextBox",
- dijit.form.NumberTextBox,
- {
-
-
-
-
-
-
-
-
-
-
-
-
- currency: "",
-
-
- baseClass: "dijitTextBox dijitCurrencyTextBox",
-
-
- regExpGen: function(constraints){
-
- return '(' + (this._focused? this.inherited(arguments, [ dojo.mixin({}, constraints, this.editOptions) ]) + '|' : '')
- + dojo.currency.regexp(constraints) + ')';
- },
-
- _formatter: dojo.currency.format,
- _parser: dojo.currency.parse,
- parse: function(/*String*/ value, /*Object*/ constraints){
-
-
-
-
- var v = this.inherited(arguments);
- if(isNaN(v) && /\d+/.test(value)){
- v = dojo.hitch(dojo.mixin({}, this, { _parser: dijit.form.NumberTextBox.prototype._parser }), "inherited")(arguments);
- }
- return v;
- },
- _setConstraintsAttr: function(/*Object*/ constraints){
- if(!constraints.currency && this.currency){
- constraints.currency = this.currency;
- }
- this.inherited(arguments, [ dojo.currency._mixInDefaults(dojo.mixin(constraints, { exponent: false })) ]);
- }
- }
- );
- }
|