Skip to Content
1
Oct 28, 2017 at 01:33 PM

How to hide SmartTable column defined by local annotation file?

8592 Views

Hi,
I created a local annotation file that I use to show an entityset in a SmartTable. I want to hide some fields from the table initially. There is the function SmartTable.setInitiallyVisibleFields but the fields that are defined there are added to the fields defined in the annotation file (see docu).

How can I then define a datafield (column) in the annotation file to be not shown initially. I've tried something (see snippet below) but all of them don't work.

<Annotation Term="UI.LineItem">
    <Collection>
        <Record Type="UI.DataField">
            <PropertyValue Property="Value" Path="Zlctbukrs"/>
            <PropertyValue Property="Label" String="{@i18n>ZLCTBUKRS}"/>
        </Record>
        <Record Type="UI.DataField">
            <PropertyValue Property="Value" Path="Zlegid"/>
            <PropertyValue Property="Label" String="{@i18n>ZLEGID}"/>
        </Record>
        <Record Type="UI.DataField">
            <PropertyValue Property="Value" Path="Zcontrnbr"/>
            <PropertyValue Property="Label" String="{@i18n>ZCONTRNBR}"/>
        </Record>
        <Record Type="UI.DataField">
            <PropertyValue Property="Value" Path="Zvalidfr1"/>
            <PropertyValue Property="Label" String="{@i18n>ZVALIDFR1}"/>
        </Record>
        <Record Type="UI.DataField">
            <PropertyValue Property="Value" Path="Zvalidto1"/>
            <PropertyValue Property="Label" String="{@i18n>ZVALIDTO1}"/>
        </Record>
        <Record Type="UI.DataField">
            <PropertyValue Property="Value" Path="Zlctconkind"/>
            <PropertyValue Property="Label" String="{@i18n>ZLCTCONKIND}"/>
        </Record>
        <Record Type="UI.DataField">
            <PropertyValue Property="Value" Path="Zcondlfd"/>
            <PropertyValue Property="Label" String="{@i18n>ZCONDLFD}">
                <Annotation Term="Common.QuickInfo" String="{@i18n>ZLCTCONKIND_T}"/>
            </PropertyValue>
            <Annotation Term="Common.FieldControl" EnumMember="Common.FieldControlType/Hidden"/>
            <Annotation Term="UI.PartOfPreview"/>
            <Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/Low"/>
        </Record>
    </Collection>
</Annotation>

Thx Helmut