Enable/disable checkbox of sap.ui.table.TreeTable depending on model data

做~自己de王妃 提交于 2019-11-30 21:36:13

问题


I use SAP UI5 version 1.52.6. Depending on model data, I would like to enable/disable a sap.ui.table.TreeTable view accordingly. see view:

<t:TreeTable id="tree">
    <t:columns>
        <t:Column>
            <t:label>
                <Label text="{i18n>serviceName}"/>
            </t:label>
            <t:template>
                <Label text="{Description}" />
            </t:template>
        </t:Column>
    </t:columns>
    <t:Column>
        <Label text="{i18n>serviceTechName}"/>
        <t:template templateShareable="true">
            <Text text="{Id}"/>
        </t:template>
    </t:Column>
</t:TreeTable>

Problem is that there is no method to enable the checkbox in TreeTable, see a similar topic being asked here:

How can one disable a checkbox, e.g. if model data of the row has a property called "Enabled" of true? I twould ry to avoid too much jQuery here but did not manage to grab the right attribute of the row anyways.


回答1:


You might want to handle the rowSelectionChange event of the table and deselect the not desired rows explicitly, and maybe combine this with a message to the user to inform about the fact.



来源:https://stackoverflow.com/questions/49428991/enable-disable-checkbox-of-sap-ui-table-treetable-depending-on-model-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!