Initial commit
[autoform-autocomplete-array.git] / common.js
blobb3cac5a2bc226b4fa3e7047f2f23ef5a0676a818
1 Matches = new Mongo.Collection("matches");
3 Matches.attachSchema(new SimpleSchema({
4   topic: {
5     type: String,
6     optional: false,
7   },
8 }));
10 Rounds = new Mongo.Collection("rounds");
12 Rounds.attachSchema(new SimpleSchema({
13   
14   matches:{
15     type: [String],
16     optional: true,
17   },
18   'matches.$': {
19     autoform: {
20       afFieldInput: {
21         type: 'autocomplete-input',
22         position: "top",
23         placeholder: 'Topic',
24         settings: {
25           position: "top",
26           limit: 5,
27           rules: [
28             {
29               collection: Matches,
30               field: "topic",
31               template: Meteor.isClient && Template.autocomplete_display
32             },
33           ]
34         }
35       }
36     }
37   }
38 }));