1
votes

I want to toggle the editability my controls inside a smarttable. * metadata of the properties is sap:updatable = true

editTogglable="true"
  • button appears, but it has no affect. Table fields are not editable.

if I initially set

editable="true"

the Table fields are editable

<smartTable:SmartTable id="ReportSmartTable" entitySet="StudentHeaderSet" tableBindingPath="/StudentHeaderSet" tableType="Table"
                header="Artikel" showRowCount="true" enableAutoBinding="true" class="sapUiResponsiveContentPadding" showFullScreenButton="true"
                smartFilterId="smartFilterBar" useVariantManagement="false" persistencyKey="SmartTableUEreport" useTablePersonalisation="true"
                 editTogglable="true" editable="true" beforeRebindTable="onBeforeRebindTable">

If I want to set the fields editiable false (during runtime) none of these snippets affect the editable fields. the fields are still editiable.

this._getSmartTableId().setEditable(false);
//this._getSmartTableId().mProperties.editable = false;

regards

2

2 Answers

1
votes

The editTogglable attribute only works for SmartField controls as the documentation suggests:

https://sapui5.hana.ondemand.com/#/api/sap.ui.comp.smarttable.SmartTable

1
votes

Just handle editable fields with a model, which you toggle in the front-end. For example:

<ui:columns>
    <ui:Column visible="true" hAlign="Left" sortProperty="PropertyName" filterProperty="PropertyName" customData:p13nData='\{"columnKey": "PropertyName", "leadingProperty":"PropertyName", "type":"string"}'>
        <Label text="Title"/>
        <ui:template>
            <Input editable="{worklistView>/editable}" value="{ path: 'PropertyName' }" />
        </ui:template>
    </ui:Column>
</ui:columns>