Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added optional datatypes

  • Loading branch information...
commit 671446c84ed19c16b27558e4358b8668d11c421c 1 parent 8667c01
@Munter Munter authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/platform/src/data/Types.js
View
15 src/platform/src/data/Types.js
@@ -189,4 +189,17 @@ Ext.data.Types = new function() {
*/
NUMBER: this.FLOAT
});
-};
+
+ Ext.iterate(this, function (key, value, obj) {
+ if (value.convert) {
+ var fn = value.convert;
+ obj[key] = {
+ convert: function (v) {
+ return (this.optional && (v === undefined || v === null)) ? null : fn(v);
+ },
+ sortType: value.sortType,
+ type: value.type
+ };
+ }
+ });
+};
Please sign in to comment.
Something went wrong with that request. Please try again.