mardi 6 janvier 2015

Select list showing items not in model

I have a model for my groups, which is basically the following fields:



  • Name

  • Users


I am populating a list in my template with the following



{{view "Ember.Select" content=model.users optionValuePath="content.id" optionLabelPath="content.name" attributeBindingds="size" size="5"}}


I load all users in the system in the controller, as so:



export default Ember.Controller.extend({
users: [],

init: function () {
this._super();

this.set('users', this.store.find('user'));
})
})


All users are populated as follows:



{{view "Ember.Select" content=users optionValuePath="content.id" optionLabelPath="content.name" attributeBindingds="size" size="5" }}


What is the most appropriate way of filtering the second select to contain only users that aren't in the first select - that is, to show users that do not exist in model.users





Aucun commentaire:

Enregistrer un commentaire