diff options
Diffstat (limited to 'sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ux/fieldCollection.js')
-rw-r--r-- | sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ux/fieldCollection.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ux/fieldCollection.js b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ux/fieldCollection.js new file mode 100644 index 000000000..ce4064f45 --- /dev/null +++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ux/fieldCollection.js @@ -0,0 +1,25 @@ +(function( app ) { + + var ux = app.ns("ux"); + + ux.FieldCollection = ux.Observable.extend({ + defaults: { + fields: [] // the collection of fields + }, + init: function() { + this._super(); + this.fields = this.config.fields; + }, + validate: function() { + return this.fields.reduce(function(r, field) { + return r && field.validate(); + }, true); + }, + getData: function(type) { + return this.fields.reduce(function(r, field) { + r[field.name] = field.val(); return r; + }, {}); + } + }); + +})( this.app ); |