Closed loadingx86 closed 4 years ago
@loadingx86 Please, make more clear example. Most probably you are trying to go with a wrong way.
ok, let's say I have some items in a dropdown for multiselect: items = [1, 2, 3 ,4 ,5]
and some rules that prevent items 2 and 3 to be selected notAllowed = [2, 3]
So, when I click "1" it is selected, and when I click "2" it is not selected and I get an alert() or something else
@loadingx86 First thing is, keep latest selected item. When selected a forbidden item, then show an alert an select the last allowed.
Can you provide some code ?
Also, if I have: [items]= [1, 2, 3 ,4 ,5] and selected: [1, 2, 3]
Now when I click x to remove "3": alert(you can not remove 3) (or some other job), and keep it selected ?
@loadingx86 The example: https://stackblitz.com/edit/ngx-select-ex-scratch-issues-178?file=src%2Fapp%2Fapp.component.ts
Thank you very much!
How can I do some job in between selecting/removing an item and when when the item is actually added/removed ?
Some kind of before action / preventDefault ?