Function to expand/collapse multiple views