Primefaces dataTable:没有allowUnsorting 属性?

发布于 2025-01-17 12:01:41 字数 753 浏览 1 评论 0原文

我正在使用 Primefacs 6.2.17。我有一个 dataTable 其中列标题可以单击以按该列对表进行排序。多次单击列标题将在升序和降序之间切换。这意味着一旦表按该列排序,用户就无法返回到不按该列排序,但我希望能够关闭该排序。 dataTables Server API 显示有一个属性 allowUnsorting ,这应该会产生所需的行为。

然而,这个属性似乎对我来说不可用,这意味着我的编程 IDE 通常会向我建议所有可用的属性,但不会建议这个属性,并且将其添加到我的代码中没有任何效果。我认为这是因为我的 Primefaces 版本较低。我是一个更大项目的一部分,因此我不能简单地决定更新 Primefaces 版本,因为我需要它来实现一些我想要实现的小功能。

这引出了两个主要问题:

  • 我在哪里可以看到何时添加了某些功能/属性以进行确认 它是否在我的版本中可用?
  • 当该功能不适用于我的版本时,有哪些选项可以解决我的问题(允许取消排序)?

I am using Primefacs 6.2.17. I have a dataTable where column-header can be clicked in order to sort the table by that column. Clicking the column-header multiple times will swap between ascending and descending ordering. This means that once the table is sorted by that column, I the user cannot go back to not-ordering by that column, but I would like to be able to turn that ordering off. The dataTables Server API shows that there is an attribute allowUnsorting , which should produce the desired behaviour.

However, this attribute doesn't seem to be available for me, meaning that my programming IDE which usually suggests all available attributes to me does not suggest this one and that adding it to my code has no effect. I assume this is because of my low Primefaces version. I am part of a bigger project and thus I can't simply decide to update the Primefaces version because I would need it for some small feature I want to implement.

This leads me to 2 main questions:

  • Where can I see when some feature/attribute was added to confirm
    whether or not it is available in my version?
  • What are the options for solving my problem (allowing unsorting) when the feature isn't available for my version?

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

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

发布评论

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

评论(1

灼疼热情 2025-01-24 12:01:41

此功能是在10.0中添加的,您始终可以检查文档或GitHub问题列表和目标版本,

我认为没有一种简单的方法可以将此功能添加到您的旧版本中。我会升级您的版本!

This feature was added in 10.0, you can always check the docs or the GitHub issue lists and target version

I dont think there is an easy way to add this feature to your old version. I would upgrade your version!

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