Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make exclude filter
Message
From
16/02/2017 12:05:37
 
General information
Forum:
AngularJS
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01647997
Message ID:
01648030
Views:
18
>>>Hi,
>>>
>>>Haven't seen Viv here lately - is he still visiting UT?
>>>
>>>I'm wondering how can I create a filter that will exclude items already selected? We do have such filter defined and in HTML it would be
>>>
>>>filter = "excludeFrom: currentOperatorsNotification.selectedOperators : 'value' : 'opCode'"
>>>
>>>
>>>I am wondering how would I rather create the filter in js code (in the controller), so I would just use
>>>filter = 'someFilterExpression'
>>
>>Still around :-}
>>But how do you determine which items are 'already selected' ? A property of the item or another array for selected items ?
>
>We have 2 object arrays. Once the item is placed in the first array, it should not be available in the other array. In other words, if the opCode is already in the currentOperatorsNotification.selectedOperators array of objects, it should be removed from the drop down choices of operators (value/label)

You could just create a custom filter using the predicate function. Check if the operator is included in the 'already selected' array and if so return false, otherwise true....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform