Hide column headers in an XPages viewPanel only when view is collapsed

77 Views Asked by At

I have a simple viewPanel in XPages with a few columns where the first column is categoriezed. When user is entering the view it is collapsed using the expandLevel= "1"

I have now a request to hide the column headers that are not displayed when the view is collapsed, and show them when one or more categories is expanded.

how can I do that?

thanks

Thomas

1

There are 1 best solutions below

1
On

Not quite sure what kind of display / layout you have in mind but I played around with that thought a bit. Just a few ideas, nothing that I really tried (don't have a server at hand right now):

Assuming that you wish to hide all column headers when all categories are fully collapsed one way you could go is to use some client side scripting setting an initial display:none styling for the data table's <thead> element; or if you can't reach thead for whatever reason you might as well address all column headers through their separate styleClass xspPanelViewColumnHeader.

Reacting to the the expand / collapse events might be a bit tricky;

Speaking of more control: all in all it might be a much better idea not to go for a view panel at all. You could instead use a <xp:dataTable> or even <xp:repeat> control which means more work but is giving you much more control over what you can achieve here. Or you even go for something like a b jQuery data table.