我无法找到一种方法来移除或设置false
的可见性,以查看sap.ui.table.TreeTable中特定行的复选框。
例如,对于下表,我想禁用或删除 subitem1-1 , subitem1-2 和 subitem2-1的复选框
请参阅以下代码示例:
sap.ui.getCore().attachInit(function() {
sap.ui.require([
"sap/ui/table/TreeTable",
"sap/ui/table/Column",
"sap/ui/model/json/JSONModel"
], function(TreeTable, Column, JSONModel) {
const treeTable = new TreeTable({
columns: [
new Column({
label: "Name",
template: "name",
}),
],
selectionMode: "MultiToggle",
enableSelectAll: true,
});
treeTable.setModel(new JSONModel({
root: {
name: "root",
description: "root description",
checked: true,
0: {
name: "item1",
description: "item1 description",
checked: true,
0: {
name: "subitem1-1",
description: "subitem1-1 description",
checked: true,
},
1: {
name: "subitem1-2",
description: "subitem1-2 description",
checked: true,
},
},
1: {
name: "item2",
description: "item2 description",
checked: true,
0: {
name: "subitem2-1",
description: "subitem2-1 description",
checked: true,
},
},
},
})).bindRows("/root").placeAt("content");
});
});

<script id="sap-ui-bootstrap"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatVersion="edge"
data-sap-ui-preload="async"
data-sap-ui-libs="sap.m, sap.ui.table, sap.ui.unified"
data-sap-ui-xx-async="true"
data-sap.ui-xx-waitForTheme="true"
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>
&#13;
非常感谢任何帮助或建议!