gpt4 book ai didi

javascript - SAPUI5 SelectDialog 中的 "Select all/Deselect all"

转载 作者:行者123 更新时间:2023-11-29 23:05:12 24 4
gpt4 key购买 nike

我有一个 SAPUI5 SelectDialog。它包含多个条目。现在,UI5 提供了使用 showClearButton="true" 清除所有选定值的属性 enter image description here

我想要实现什么?我想实现类似的功能,以在对话框中“选择所有”条目。我知道 sap.m.tableSelectDialog 提供了这个,但我如何在 SelectDialog 中执行此操作?可能的解决方案包括

  1. 顶部的复选框,上面写着“全选/取消全选”
  2. SelectDialog 页脚中的按钮,显示“全选/取消全选”。 enter image description here

欢迎提出任何建议。

最佳答案

SelectDialog 的用例是单向绑定(bind)。这意味着您提供一个项目列表,并在适当的模式下使用对话框,它的功能将是为您提供所选择的内容(即不是让您操纵复选框的值)

如果要实现此目的,为什么不在对话框中使用列表(而不是 SelectDialog)?如果你适本地绑定(bind)它,就会有一个列表项类型

<InputListItem label="Your Label">
<CheckBox selected="true" />

这对您来说可能有值(value)吗?

来自documentation :

List structure & selection The search field triggers the events search and liveChange where a filter function can be applied to the list binding. The growing functionality of the list does not support two-way Binding, so if you use this control with a JSON model make sure the binding mode is set to OneWay and that you update the selection model manually with the items passed in the confirm event. In the multi-select mode of the select dialog, checkboxes are provided for choosing multiple entries. You can set rememberSelections to true to store the current selection and load this state when the dialog is opened again. When cancelling the selection, the event change will be fired and the selection is restored to the state when the dialog was opened.

关于javascript - SAPUI5 SelectDialog 中的 "Select all/Deselect all",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54926683/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com