Wijmo5 flexgrid支持排序。
默认的wijmo5 flexgrid支持排序,当点击HeaderCell上的时候,可以进行升序,降序排序。
本文就来介绍如何进行多列排序。
进行多列排序,我们要使用的是CollectionView(接口请参考产品文档:http://demo.grapecity.com.cn/wijmo5/tutorialsample/topic/wijmo.collections.CollectionView.Class.html)。
可以使用它的SortDesciption定义排序(接口:http://demo.grapecity.com.cn/wijmo5/tutorialsample/topic/wijmo.collections.SortDescription.Class.html)。
多列排序代码参考:
function MultiFilter() {
grid.beginUpdate();
var cv = grid.collectionView;
var country = new wijmo.collections.SortDescription('country', true);
var date = new wijmo.collections.SortDescription('date', true);
var amount = new wijmo.collections.SortDescription('amount', true);
cv.sortDescriptions.push(country);
cv.sortDescriptions.push(date);
cv.sortDescriptions.push(amount);
cv.refresh()
grid.endUpdate();
}
排序效果如图所示:
本文所用的版本是Wijmo 2016V1。
源代码下载:
更多资源:
Wijmo中文官网:/developer/wijmojs
Wijmo5在线示例:/developer/wijmojscore
Wijmo5产品文档:/developer/wijmojscore
如果依然有问题,可以到我们的官方产品论坛发帖咨询:http://gcdn.grapecity.com.cn/showforum-140.html
请参考Wijmo5技术文章汇总
ComponentOne Enterprise | 下载试用
ComponentOne 是一套专注于企业 .NET开发、支持 .NET Core 平台,并完美集成于 Visual Studio 的第三方控件集,包含 300 多种 .NET开发控件,提供表格数据管理、数据可视化、报表和文档、日程安排、输入和编辑、导航和布局、系统提升工具等七大功能,被誉为“.NET开发的‘瑞士军刀’”。
ComponentOne 为您提供专业的产品咨询服务,并由技术支持工程师为您1对1解答。>> 发帖提问
葡萄城热门产品


