gpt4 book ai didi

jquery - jqGrid默认排序顺序?

转载 作者:行者123 更新时间:2023-12-03 21:57:39 24 4
gpt4 key购买 nike

看来 jqGrid sortnamesortorder 属性实际上并不会导致数据集排序 - 它们只是导致显示向上/向下箭头。

如何让数据集在下载时进行排序?

当您单击列标题时,排序效果很好,但我希望将默认排序应用于我们的数据。

<小时/>

更新:当我们点击下一步按钮时,下一个请求会对数据进行排序。

这会导致用户界面稍微困惑,其中数据在列上通过向下箭头加载 - 并且数据未排序 - 但当您单击“下一步”时,数据现在已排序。

如果我省略 sortname 和 sortorder,jqGrid 似乎仍然显示排序图标 - 很奇怪。

最佳答案

您可能会两次给出相同的参数(复制粘贴编程时非常常见的错误:),无意冒犯。我也这么做。)

假设您想按 OpeningDate 降序排序

..... options .... 
sortname: "OpeningDate",
sortorder: "desc", <---- assume you write this line and expect to sort descending
..... some other options ....
sortorder: "asc", <---- and this line may also be there but you may not be noticing it
..... and other options ....

第二个“sortorder”选项会覆盖第一个,您将无法按降序排序

关于jquery - jqGrid默认排序顺序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3730222/

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