Skip to content

Instantly share code, notes, and snippets.

@mauritslamers
Created September 29, 2008 14:38
Show Gist options
  • Save mauritslamers/13611 to your computer and use it in GitHub Desktop.
Save mauritslamers/13611 to your computer and use it in GitHub Desktop.
_assignedCommissionMembersBinding: 'AdmissionExam.currentExamCommissionController.arrangedObjects',
_assignedCommissionMembersObserver: function(){
var assignedMembers = this.get('_assignedCommissionMembers');
if((assignedMembers) && (assignedMembers.length>0) && (this.get('content')) && (this.get('arrangedObjects').length>0)){
var leaveOut = assignedMembers.get('guid');
var allGuids = this.get('content').get('records').get('guid');
var conditionArray = [];
allGuids.each(function(s){
var pos = leaveOut.indexOf(s);
if(pos<0){
// only returns > 0 if found
conditionArray.push(s);
}
});
this.get('content').set('conditions',{ 'guid': conditionArray });
}
}.observes('_assignedCommissionMembers')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment