How to set default presentation for table

I have a table with many columns(20+)… But i want some 5 columns as defaulty shown in the table… I know we can save the presentation by unchecking the column in the presentation. But how do i make only those 5 columns are selected by default…?

In the xml of your table, add collapsed=“true” for columns that you want hidden initially.


Thanks for the information. But in my case… I’ve dynamic fields also, How do i set collapsed=true for dynamic fields?


Could you clarify, what do you mean by dynamic fields? Are these columns generated columns or correspond to dynamic attributes?


Sorry… I actually meant Dynamic Attributes…

Only option I can think of is looping the table columns in code and set them to collapse except for the intended ones. Don’t know how that holds with presentations.

Alternatively you could loop the dynamic attributes instead of the table columns.


Thanks for the reply
Can anybody share some code samples. So, i can learn and use…

Here is a straightforward piece of code doing it (not tested):

public void init(Map<String, Object> params) {

     yourTable.getColumns().forEach(c -> c.setCollapsed(true));
     // Set columns visible as needed

Thank you It works as expected…