is there any way to hide a column from responsive table connected to OData from the user. I do not have in mind now setVisible(false) because the user can chose the column from the settings button. So - is there a way to set the columns to be selected in the settings or hide it permanently (remove from metadata ?). I tried also with the annotations in CDS View @UI.hide but this does not work, unfortunately.
1
votes
Which control do you want to use? sap.m.Table is known as “Responsive Table” and is not “smart”, that is not aware of annotations. sap.ui.comp.smarttable.SmartTable is annotation aware. In the SDK for the Smart Table there is a reference to the annotations used by this control. Please check “FieldControlType”.
– user6177399
I use SmartTable and the type is Responsive so the underlying table is sap.m.Table. I do not want to change that, but want to be able to disable a column/field from the settings, so that user is not able to chose it and display in the table. In ABAP and ALV tables we set this as "technical" column so that it's not possible to pick it in the layout.
– Kubas
Please check the last two sentences. In the SDK for the Smart Table, there is a reference to the annotations used by this control. Check “FieldControlType”.
– user6177399
Using ignoreFromPersonalisation param from the smarttable resolves the issue.
– Kubas
2 Answers
3
votes
The param ignoreFromPersonalization allows to decide whether the user is able to select and see the column in the table (in below example column1 and column2 will not be selectable in the personalization dialog).
<smartTable:SmartTable
id="tblOverview"
(...)
ignoreFromPersonalisation="column1,column2">
Hope it helps for those who had, have, will have this issue/request.
0
votes
You can bind the aggregation of columns to a model property of your choosing (for example a custom metadata model, which you can define and update yourself any way you like).
The table will then automatically update whenever your metadata model is updated.
The code will depend on whether your views use JS/XML views, but if you look up aggregation binding for your type of view you should get it working in no-time