Hiding Elements with a toggle

I see. You can make it a little more simple then I think and drop the part that checks on the current status and the updated label with something like below.

The difference between hide and collapse as I understand it is that hide keeps a place holder on the page for an item and collapse doesn’t. If you were hiding an entire strip but not collapsing it then the deadspace from the strip would still show. I usually play with one or the other or both to see how it works best for what I’m trying to achieve.

export function yourSWITCHNAME ( event ) {
if ( $w ( ‘#yourSWITCHNAME’ ). checked ) {
$w ( ‘#itemYOUWANTTOHIDE’ ). expand ()
//next item to expand
} else
$w ( “#itemYOUWANTTOHIDE” ). collapse ()
//next item to collaps
}