this.columns = [
{data: 0, type: 'text', sortFunction: function(sortOrder) {
return function(before, next) {
// 中文排序逻辑
return before['1'].localeCompare(next['1'], 'zh-CN');
}
}},
{data: 2, type: 'text'},
];
handsoontable的中文排序需要给表格的相应表头列来设置中文排序的相关逻辑。
如上代码中的this.columns即是设置表格的表头,中文排序则是需要用到自定义的排序方法,给表头配置sortFunction的方法即可。
效果如图: