Skip to content

表格数据排序问题 #244

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

Closed
jave-joe opened this issue Jun 27, 2019 · 4 comments
Closed

表格数据排序问题 #244

jave-joe opened this issue Jun 27, 2019 · 4 comments

Comments

@jave-joe
Copy link

jave-joe commented Jun 27, 2019

版本号:2.0
问题描述:

前端在表格列信息上增加属性sorter: true即可实现点击表头进行排序,但是如果遇到_dictText字段的时候(即查询显示的列是系统字典里翻译过来的字段),的时候传递给后台order by的时候应该要去掉 _dictText才行,不然带入到sql中会提示字段不存在.
另外,在前端JeecgListMixin.js中isorter有个默认排序字段的设置,create_time desc,这样个人觉得不太妥当,如果需要排序可以在前台传递,而没必要给一个默认排序,如果当前的查询没有create_time字段呢?

截图&代码:
@zhangdaiscott
Copy link
Member

第二个问题解答:

/* 排序参数 */
isorter:{
column: 'createTime',
order: 'desc',
},

可以再每个页面重写

@zhangdaiscott
Copy link
Member

第一个问题,已经处理,下个版本发布

@w1lkin
Copy link

w1lkin commented Apr 15, 2022

请问多字段排序应该怎么写?例如第一个字段倒序,第二段正序...

@w1lkin
Copy link

w1lkin commented Apr 15, 2022

请问多字段排序应该怎么写?例如第一个字段倒序,第二段正序...

已解决,附上代码
isorter: {
column: 'a desc,b',
order: 'asc'
},

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

No branches or pull requests

3 participants