在我在PowerApps中排序之后,如何将画廊重置为默认值?

发布于 2025-02-08 21:58:38 字数 344 浏览 2 评论 0原文

排序按钮(ONSELECT):

UpdateContext({sortGrade: !sortGrade})

图库中的项目:

SortByColumns(Filter(
Search(
    Table1,
    TextInputSearch_3.Text,
    "Name2"
), "Cumulative Grade Point Average (CGPA)/Grade", If(sortGrade, Descending, Ascending))

当排序级为false时,我希望画廊回到默认布置时,而不是排序升级,这是可能的吗?

Sort button (OnSelect):

UpdateContext({sortGrade: !sortGrade})

Items in Gallery:

SortByColumns(Filter(
Search(
    Table1,
    TextInputSearch_3.Text,
    "Name2"
), "Cumulative Grade Point Average (CGPA)/Grade", If(sortGrade, Descending, Ascending))

Instead of it sort to ascending when the sortGrade is false, I want the gallery back to default arrangement, is it possible?

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

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

发布评论

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

评论(1

谢绝鈎搭 2025-02-15 21:58:38

幸运的是,我找到了我自己问题的答案,因此,对于任何可能会在PowerApps中遇到相同问题的人:

If(sortGrade=false,SortByColumns(Filter(
  Search(
   Table1,
   TextInputSearch_3.Text,
   "Name2"
   ), "Name2"),SortByColumns(Filter(
  Search(
   Table1,
   TextInputSearch_3.Text,
   "Name2"
   ),"Cumulative Grade Point Average (CGPA)/Grade", If(sortGrade, Descending)))

因此,当sortgradefalse时,画廊将在默认安排中(通过name2)。

Luckily, I found an answer for my own question, so here it is for anyone that may encounters the same problem in PowerApps:

If(sortGrade=false,SortByColumns(Filter(
  Search(
   Table1,
   TextInputSearch_3.Text,
   "Name2"
   ), "Name2"),SortByColumns(Filter(
  Search(
   Table1,
   TextInputSearch_3.Text,
   "Name2"
   ),"Cumulative Grade Point Average (CGPA)/Grade", If(sortGrade, Descending)))

So when the sortGrade is false, the Gallery will be in the default arrangement (by Name2).

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