cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

initiallyVisibleFields SmartTable property not working with JSONModel-based SmartTable

ragnarox97
Explorer
0 Kudos
545

Hi,

I created a SmartTable that takes data from a simple JSON model instead of an oData service. This is possible as you can see from here.
The table has many columns (I won't list them all for convenience), so I would like to display only some of them in the beginning. I tried to use the initiallyVisibleFields property by inserting the name of the data as it is written in the JSON model (and also as I recall it in the items), but when I go to test all the columns are still visible.

All data is shown correctly in the rows.

What am I doing wrong?

 

 

<st:SmartTable
    entitySet="BPSet"
    tableBindingPath="BPModel>/"
    header="{i18n>contractsList}"
    showRowCount="true"
    tableType="Table"
    showFullScreenButton="false"
    useVariantManagement="false"
    enableAutoBinding="true"
    enableExport="true"
    useTablePersonalisation="true"
    initiallyVisibleFields="Ebeln,Name1"
>
    <st:customToolbar>
        <m:OverflowToolbar design="Transparent">
            <m:ToolbarSpacer />
            <m:Button
                id="ButtonFilter"
                type="Emphasized"
                icon="sap-icon://filter"
                text="{i18n>contractsAllowed}"
                width="auto"
                enabled="true"
                iconDensityAware="false"
                press="contractsAllowedFilter"
            />
            <m:Button
                id="ButtonRefresh"
                type="Emphasized"
                text="{i18n>refresh}"
                tooltip="{i18n>refresh}"
                press="getRunItems"
                icon="sap-icon://refresh"
            />
            <m:Button
                id="ButtonTacitRenewal"
                type="Emphasized"
                text="{i18n>tacitRenewal}"
                tooltip="{i18n>tacitRenewal}"
                width="auto"
                enabled="true"
                iconDensityAware="false"
                press="onTacitRenewal"
            />
            <m:ToolbarSpacer />
        </m:OverflowToolbar>
    </st:customToolbar>
    <m:Table
        id="detailContractsTable"
        mode="MultiSelect"
        itemPress="toListaDoc"
    >
        <m:columns>
            <m:Column>
                <m:customData>
                    <core:CustomData
                        key="p13nData"
                        value='{"columnKey": "Ebeln", "leadingProperty": "Ebeln"}'
                    />
                </m:customData>
                <m:Text text="{i18n>ContractId}" />
            </m:Column>
            <m:Column>
                <m:customData>
                    <core:CustomData
                        key="p13nData"
                        value='{"columnKey": "Name1", "leadingProperty": "Name1"}'
                    />
                </m:customData>
                <m:Text text="{i18n>Name}" />
            </m:Column>
            <m:Column>
                <m:customData>
                    <core:CustomData
                        key="p13nData"
                        value='{"columnKey": "createdAt", "leadingProperty": "createdAt"}'
                    />
                </m:customData>
                <m:Text text="{i18n>creationDate}" />
            </m:Column>
            <m:Column>
                <m:customData>
                    <core:CustomData
                        key="p13nData"
                        value='{"columnKey": "createdBy", "leadingProperty": "createdBy"}'
                    />
                </m:customData>
                <m:Text text="{i18n>createdBy}" />
            </m:Column>
            <m:Column>
                <m:customData>
                    <core:CustomData
                        key="p13nData"
                        value='{"columnKey": "modifiedAt", "leadingProperty": "modifiedAt"}'
                    />
                </m:customData>
                <m:Text text="{i18n>modifiedAt}" />
            </m:Column>
            <m:Column>
                <m:customData>
                    <core:CustomData
                        key="p13nData"
                        value='{"columnKey": "modifiedBy", "leadingProperty": "modifiedBy"}'
                    />
                </m:customData>
                <m:Text text="{i18n>modifiedBy}" />
            </m:Column>
            <m:Column>
                <m:customData>
                    <core:CustomData
                        key="p13nData"
                        value='{"columnKey": "Status", "leadingProperty": "Status"}'
                    />
                </m:customData>
                <m:Text text="{i18n>status}" />
            </m:Column>
        </m:columns>
        <m:items>
            <m:ColumnListItem
                type="Navigation"
                press="onPress"
            >
                <m:cells>
                    <m:Text text="{BPModel>Ebeln}" />
                    <m:Text text="{BPModel>Name1}" />
                    <m:Text text="{BPModel>createdAt}" />
                    <m:Text text="{BPModel>createdBy}" />
                    <m:Text text="{BPModel>modifiedAt}" />
                    <m:Text text="{BPModel>modifiedBy}" />
                    <m:Text text="{BPModel>Status}" />
                </m:cells>
            </m:ColumnListItem>
        </m:items>
    </m:Table>
</st:SmartTable>

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion
0 Kudos

it is not supported. please forget it.

ragnarox97
Explorer
0 Kudos

What does it means It's not supported? The property initiallyVisibleFields is not supported? It's like It doesn't exists?

So I have to go for a manual way to manage the initial columns visibility?

junwu
SAP Champion
SAP Champion
0 Kudos
working with jsonmodel is not supported in smart thing.