【问题标题】:toggle editability of smarttable切换智能表的可编辑性
【发布时间】:2019-05-15 09:00:58
【问题描述】:

我想在智能表中切换我的控件的可编辑性。 * 属性的元数据是 sap:updatable = true

editTogglable="true"
  • 按钮出现,但没有任何影响。表格字段不可编辑。

如果我最初设置了

editable="true"

表格字段是可编辑的

<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">

如果我想将字段设置为 false(在运行时),这些 sn-ps 都不会影响可编辑字段。这些字段仍然可以编辑。

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

问候

【问题讨论】:

    标签: sapui5


    【解决方案1】:

    只需在前端切换模型即可处理可编辑字段。例如:

    <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>
    

    【讨论】:

      【解决方案2】:

      editTogglable 属性仅适用于文档建议的 SmartField 控件:

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

      【讨论】:

      • 感谢您的提示。我尝试在表格中使用 SmartField 控件,但没有按预期工作
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-05
      • 1970-01-01
      • 2020-08-14
      • 2021-12-19
      • 1970-01-01
      • 2020-12-12
      相关资源
      最近更新 更多