(I have to share this trick that came to me in my sleep...)
It's bothered me for a long time.
On hosted solutions, performance on list view suffers when a lot of data is displayed -- especially related data. Sometimes, but not always, it's desirable to take the performance hit to see more columns of key information in the list. Now thanks to merge variables, my users can dynamically hide (or display) columns in a list view, enjoying (or suffering) the performance consequences of their choices.
I'm sure there are other means of doing this; here's what I did. I used a field, a value list, a script, and some layout merge variables. I used the field (as a global) to display the value list check boxes so the user can select which columns to display. Attach an onFieldModify trigger to it to refresh the view. Within the conditional formating dialog of layout objects I defined a $$globalVariable for each optional column (corresponding to the user's selections) and a $localVariable for the data display.
Check out the attached file for all the details.
TIP: be sure to define the local merge variables in a record field object. When I defined them in the text object holding the merge variable, they displayed data from the wrong record!
The best part? When tested on a list with multiple related columns on a large hosted solution, it delivers the expected speed improvement, .
I hope others find it useful. Please comment, and share ideas to improve it.