当复选框为true时,隐藏了整个行,​​包括PowerApps中的字段

发布于 2025-02-03 20:31:03 字数 243 浏览 3 评论 0原文

我是PowerApps的新手,当复选框为TRUE时,我正在尝试从列表中隐藏一行,并在False时可见。

有什么想法吗?感谢您的理解。

I'm new in PowerApps and I'm trying to hide a row from a list when the checkbox is true and leave visible when false.

enter image description here

Any ideas? Thank you for your understanding.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

[旋木] 2025-02-10 20:31:03

您可以手动将属性添加到数据中,例如名为 hide 的布尔值。
这样,您就可以执行过滤器:filter(< yourdata> hide<> true)

要添加您的列:clearCollect(newcol,addColumns(oldcol,hide hide',false)));

以下时,当您单击复选框时,它是 on Change evert conge Event均可更改 thisitem 的值使其从列表中消失。但是,数据仍然存在。它只是不会在桌子/画廊中显示。

You could add a property manually to your data, say a boolean named Hide.
This way, then you can perform a filter: Filter(<yourdata>, Hide <> true).

To add your column: ClearCollect(NewCol,AddColumns(OldCol,"Hide",false));

This way, when you click on the checkbox, it's OnChange event could change ThisItem's value to make it disappear from the list. The data is still there, though. It just won't show it in the table/gallery anymore.

蘸点软妹酱 2025-02-10 20:31:03

取决于您想对隐藏的值做什么。我假设导入时所有复选框值都是true

模拟数据:

ClearCollect(colTasks,
    {check: true, taskName: "task1 ZI rep1", desc: "", startDate: "19/05/2022", assignedTo: "Bob", dueDate: "31/05/2022"},
    {check: true, taskName: "task2 ZI rep2", desc: "", startDate: "01/05/2022", assignedTo: "Sally", dueDate: "28/05/2022"},
    {check: true, taskName: "task3 ZI rep1", desc: "", startDate: "16/05/2022", assignedTo: "Sam", dueDate: "17/05/2022"},
    {check: true, taskName: "task4 ZI rep1", desc: "", startDate: "01/06/2022", assignedTo: "Smithy", dueDate: "05/06/2022"},
    {check: true, taskName: "task5 ZI rep2", desc: "", startDate: "18/05/2022", assignedTo: "Joe", dueDate: "31/05/2022"},
    {check: true, taskName: "task6 ZI rep1", desc: "", startDate: "15/05/2022", assignedTo: "Billy Bob", dueDate: "03/06/2022"},
    {check: true, taskName: "task7 ZI rep2", desc: "", startDate: "03/05/2022", assignedTo: "Bobby Sue", dueDate: "25/05/2022"}
)

尝试以下操作:

  1. 将以下内容添加到复选框的属性:
// Changes the checkbox value to `false`

Patch(
    colTasks,
    ThisItem,
    {
        check: false
    }
);

//Collects the record in another collection in case you need it

Collect(colRemovedTasks, ThisItem);

//Removes the record from the current collection

RemoveIf(colTasks, check = false)

然后您可以拥有另一个画廊控制用户可以选择的画廊控制哪些要添加!

  • Just Chance收集名称并将上述代码粘贴在第二个复选框上OnunSelect property

插图:

“

Depends on what you want to do with the hidden values. I'm assuming all checkbox values are true upon import.

Mock data:

ClearCollect(colTasks,
    {check: true, taskName: "task1 ZI rep1", desc: "", startDate: "19/05/2022", assignedTo: "Bob", dueDate: "31/05/2022"},
    {check: true, taskName: "task2 ZI rep2", desc: "", startDate: "01/05/2022", assignedTo: "Sally", dueDate: "28/05/2022"},
    {check: true, taskName: "task3 ZI rep1", desc: "", startDate: "16/05/2022", assignedTo: "Sam", dueDate: "17/05/2022"},
    {check: true, taskName: "task4 ZI rep1", desc: "", startDate: "01/06/2022", assignedTo: "Smithy", dueDate: "05/06/2022"},
    {check: true, taskName: "task5 ZI rep2", desc: "", startDate: "18/05/2022", assignedTo: "Joe", dueDate: "31/05/2022"},
    {check: true, taskName: "task6 ZI rep1", desc: "", startDate: "15/05/2022", assignedTo: "Billy Bob", dueDate: "03/06/2022"},
    {check: true, taskName: "task7 ZI rep2", desc: "", startDate: "03/05/2022", assignedTo: "Bobby Sue", dueDate: "25/05/2022"}
)

Try this:

  1. Add the following to the OnUncheck property of the Checkbox:
// Changes the checkbox value to `false`

Patch(
    colTasks,
    ThisItem,
    {
        check: false
    }
);

//Collects the record in another collection in case you need it

Collect(colRemovedTasks, ThisItem);

//Removes the record from the current collection

RemoveIf(colTasks, check = false)

Then you can have another Gallery control where the users can pick which ones to add back!

  • Just chance the collection name and paste the above code on the second Checkboxes OnUnselect property

Illustration:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文