SelectAll and Invert select with multiselect OptionGroup

Hi all,

I’ve been digging on the net without any success. Maybe someone here can help me. I have an OptionGroup with multiselect enabled. An implementation with “Select none” works perfectly, but for my life the “Select all” and “Invert Select” just refuses to fly. Can someone help me please with a sensible solution for these use cases?

Thanks in advance.!/thread/184997 shows how to solve this problem.