mardi 2 décembre 2014

Meteor Autoform - disable select options in an array of Object fields


I'm wanting to disable an option if it has already been selected in one of the object groups.


So, if I selected "2013" then added another sample, "2013" would not be available in that group, unless that option is changed in the original group.


Is there an easy way to do this that I'm missing? Do I need to reactively update the schema when a selection is made?



samples:{
type: Array,
optional: true,
maxCount: 5
},
"samples.$":{
type: Object,
optional: true
},

"samples.$.sample":{
type:[String],
autoform: {
type: "select",
options: function () {
return [
{
optgroup: "Group",
options: [
{label: "2013", value: 2013},
{label: "2014", value: 2014},
{label: "2015", value: 2015}
]
}
];
}
}

},




Aucun commentaire:

Enregistrer un commentaire