Enable/disable checkbox of sap.ui.table.TreeTable

2019-02-16 00:34发布

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条回答
够拽才男人
2楼-- · 2019-02-16 01:06

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.

查看更多
登录 后发表回答