CurrencyTextBox.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. if (!dojo._hasResource["dijit.form.CurrencyTextBox"]) { // _hasResource checks
  2. // added by build. Do
  3. // not use _hasResource
  4. // directly in your
  5. // code.
  6. dojo._hasResource["dijit.form.CurrencyTextBox"] = true;
  7. dojo.provide("dijit.form.CurrencyTextBox");
  8. // FIXME: dojo.experimental throws an unreadable exception?
  9. // dojo.experimental("dijit.form.CurrencyTextBox");
  10. dojo.require("dojo.currency");
  11. dojo.require("dijit.form.NumberTextBox");
  12. dojo.declare("dijit.form.CurrencyTextBox", dijit.form.NumberTextBox, {
  13. // code: String
  14. // the ISO4217 currency code, a three letter sequence like "USD"
  15. // See http://en.wikipedia.org/wiki/ISO_4217
  16. currency : "",
  17. regExpGen : dojo.currency.regexp,
  18. format : dojo.currency.format,
  19. parse : dojo.currency.parse,
  20. postMixInProperties : function() {
  21. if (this.constraints === dijit.form.ValidationTextBox.prototype.constraints) {
  22. // declare a constraints property on 'this' so we don't
  23. // overwrite the shared default object in 'prototype'
  24. this.constraints = {};
  25. }
  26. this.constraints.currency = this.currency;
  27. dijit.form.CurrencyTextBox.superclass.postMixInProperties.apply(
  28. this, arguments);
  29. }
  30. });
  31. }