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

表格多字段排序时,只有一个起作用 #24

Closed
helloworld88888888 opened this issue May 11, 2020 · 1 comment
Closed

表格多字段排序时,只有一个起作用 #24

helloworld88888888 opened this issue May 11, 2020 · 1 comment

Comments

@helloworld88888888
Copy link

排序设置:
sortOrder: 'asc',
sortName: 'ReportTime,AqiValue,Pm25Iaqi,Pm10Iaqi',
实际只有最后一个有效。
我的办法:
修改数据库排序字段处理,sqlserver修改:SqlServerDatabase.cs 下
private async Task<(int total, IEnumerable list)> FindList(IQueryable tempData, string orderField, bool isAsc, int pageSize, int pageIndex)

            if(index==0 )
                resultExp = Expression.Call(typeof(Queryable), isAsc ? "OrderBy" : "OrderByDescending", new Type[] { typeof(T), property.PropertyType }, tempData.Expression, Expression.Quote(orderByExp));
            else
                resultExp = Expression.Call(typeof(Queryable), isAsc ? "ThenBy" : "OrderByDescending", new Type[] { typeof(T), property.PropertyType }, resultExp, Expression.Quote(orderByExp));
@liukuo362573
Copy link
Owner

谢谢你的反馈,回头我会根据你这个修改一下。

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

2 participants