cancel
Showing results for 
Search instead for 
Did you mean: 

show or hide the field of list table in SAP UI5

huanglin
Explorer
0 Kudos
2,741

hi,anyone knows the demo for show or hide the field for list?exmaple like(choose layout in AVL).I think there is a parameter to control it

Accepted Solutions (1)

Accepted Solutions (1)

himanshupensia
Participant
0 Kudos

Hi huang,

Try to get columns and respective fields by Id and then show on as per requirement.

<Table id="idProductsTable" items="{ path: '/nameofentityset' }">
<columns>
<Column id="column1">
<Label  text="MATNR" />
</Column>
<Column id="column2">
<Label text="MAKTX" />
</Column>
<columns>
<ColumnListItem>
<Text id="text1" text="{matnr}"/>
<Text id="text2" text="{maktx}"/>
</ColumnListItem>
</Table>
this.getView().byId("column1").setVisible(false);
this.getView().byId("text1").setVisible(false);

Answers (2)

Answers (2)

maheshpalavalli
Active Contributor
0 Kudos

Like Jun mentioned you can use Smart table. Here are below ways to do it.

1. User variant management to control the table columns => If you use smart table it is way easier to do it as smart table and smart variant management has very tight integration

2. Use list report template which automatically provides variant management and a smart table for you,

3. If you dont want to use variant management and control it manually by writting code(which i wont recommend) then use the binding to visible property of table columns and hide them based on ur scenario logic.

junwu
Active Contributor
0 Kudos

if you use smart table, it is all done by sap. you don't have to do anything.