Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table 表格远程排序一直是descend #41430

Closed
lsq33123 opened this issue Mar 24, 2023 · 6 comments
Closed

Table 表格远程排序一直是descend #41430

lsq33123 opened this issue Mar 24, 2023 · 6 comments

Comments

@lsq33123
Copy link

Reproduction link

Edit on CodeSandbox

Steps to reproduce

点击字段排序,onchange排序方式未变化

What is expected?

正常变化

What is actually happening?

未变化

Environment Info
antd 5.3.2
React 18.2.0
System win10
Browser chrome
@MuxinFeng
Copy link
Contributor

这里仅仅将 sorter 设置为 true 是没用的哈,还需要服务端配合。
可以理解为这个时候只有 sorter 对应的 ui 交互效果,然后你拿到 sorter 的值传给服务端,服务端做好排序再把结果给你。

@zombieJ
Copy link
Member

zombieJ commented Mar 24, 2023

@MuxinFeng 的回复,远程数据是由远程控制,前端只是做展示用。

@zombieJ zombieJ closed this as completed Mar 24, 2023
@lsq33123
Copy link
Author

Reference i

我知道数据是由服务端排序的,我的问题是表格的箭头的排序方式不会 切换 一直都是descend

@lsq33123
Copy link
Author

这里仅仅将 sorter 设置为 true 是没用的哈,还需要服务端配合。 可以理解为这个时候只有 sorter 对应的 ui 交互效果,然后你拿到 sorter 的值传给服务端,服务端做好排序再把结果给你。

按道理来说,每点击一下排序方式都会变,现在是不变的(我指的不是数据)

@MuxinFeng
Copy link
Contributor

你在每次点击排序后,都会重新请求数据,然后重置 tableData,引起整个表格组件的刷新,所以看起来好像排序的交互没有触发一样。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants