Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2150 mathias 1
if(!dojo._hasResource["dijit.form.NumberTextBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2
dojo._hasResource["dijit.form.NumberTextBox"] = true;
3
dojo.provide("dijit.form.NumberTextBox");
4
 
5
dojo.require("dijit.form.ValidationTextBox");
6
dojo.require("dojo.number");
7
 
8
dojo.declare(
9
	"dijit.form.NumberTextBoxMixin",
10
	null,
11
	{
12
		// summary:
13
		//		A mixin for all number textboxes
14
		regExpGen: dojo.number.regexp,
15
 
16
		format: function(/*Number*/ value, /*Object*/ constraints){
17
			if(isNaN(value)){ return ""; }
18
			return dojo.number.format(value, constraints);
19
		},
20
 
21
		parse: dojo.number.parse,
22
 
23
		filter: function(/*Number*/ value){
24
			if(typeof value == "string"){ return this.inherited('filter', arguments); }
25
			return (isNaN(value) ? '' : value);
26
		},
27
 
28
		value: NaN
29
	}
30
);
31
 
32
dojo.declare(
33
	"dijit.form.NumberTextBox",
34
	[dijit.form.RangeBoundTextBox,dijit.form.NumberTextBoxMixin],
35
	{
36
		// summary:
37
		//		A validating, serializable, range-bound text box.
38
		// constraints object: min, max, places
39
	}
40
);
41
 
42
}