-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
👑 ProTable 多列服务器端排序指定初始字段方向和排序顺序 #8165
Comments
以下的 Issues 可能会帮助到你 / The following issues may help you
|
问题已解决,单独维护一份 sort 和组件内的 sort 做同步 |
column.sorter 支持 multiple 字段以配置多列排序优先级。通过 sorter.compare 配置排序逻辑,你可以通过不设置该函数只启动多列排序的交互形式。 |
这个字段 |
🔩 所属模块或组件
ProTable
🥰 需求描述
https://procomponents.ant.design/components/table#columns-%E5%88%97%E5%AE%9A%E4%B9%89
在定义 table 的 columns 时,可以配置
defaultSortOrder
来控制该列的默认排序方向(升降序)但是在服务器多列排序时,没有字段可以设置初始化时的排序优先级
⛰ 功能需求适用场景
服务器端多列排序时,我通过 ProTable 组件的 onChange 事件的回调来同步排序状态至 url,我的处理类似于这样的拼接
&sort=name__ascend%2Cemail__ascend%2Cmobile__ascend
在重新刷新页面时,我通过解析 url,把排序的字段写入对应列的
defaultSortOrder
。当预期排序顺序与 table 字段排序顺序一致时,则 ProTable 的
request
函数中能拿到预期顺序的 sort 参数;当预期排序顺序与 table 字段排序顺序不一致时,则 ProTable 的request
函数中的 sort 参数顺序和 table 的字段顺序一致;🧐 解决方案
🚑 其他信息
🈚️
The text was updated successfully, but these errors were encountered: