]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dijit/form/CurrencyTextBox.js
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dijit / form / CurrencyTextBox.js
1 if(!dojo._hasResource["dijit.form.CurrencyTextBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dijit.form.CurrencyTextBox"] = true;
3 dojo.provide("dijit.form.CurrencyTextBox");
4
5 //FIXME: dojo.experimental throws an unreadable exception?
6 //dojo.experimental("dijit.form.CurrencyTextBox");
7
8 dojo.require("dojo.currency");
9 dojo.require("dijit.form.NumberTextBox");
10
11 dojo.declare(
12         "dijit.form.CurrencyTextBox",
13         dijit.form.NumberTextBox,
14         {
15                 // summary:
16                 //              A validating currency textbox
17                 //
18                 // constraints: dijit.form._DateTimeTextBox.__Constraints 
19                 //
20                 // currency: String
21                 //              the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
22                 currency: "",
23
24                 /*=====
25                 constraints: {},
26                 ======*/
27
28                 regExpGen: dojo.currency.regexp,
29                 _formatter: dojo.currency.format,
30 /*=====
31                 parse: function(value, constraints){
32                         //      summary: parses the value as a Currency, according to constraints
33                         //      value: String
34                         //
35                         //      constraints: dojo.currency.__ParseOptions
36                 },
37 =====*/
38                 parse: dojo.currency.parse,
39
40                 postMixInProperties: function(){
41                         if(this.constraints === dijit.form.ValidationTextBox.prototype.constraints){
42                                 // declare a constraints property on 'this' so we don't overwrite the shared default object in 'prototype'
43                                 this.constraints = {};
44                         }
45                         this.constraints.currency = this.currency;
46                         dijit.form.CurrencyTextBox.superclass.postMixInProperties.apply(this, arguments);
47                 }
48         }
49 );
50
51 }