fix provide more parameters for getting multi-sort value

This commit is contained in:
gx2025f 2021-01-12 10:52:49 +08:00
parent 88e02b38b6
commit 1f1a2a3914
4 changed files with 6 additions and 6 deletions

View File

@ -211,8 +211,8 @@ function sort(Table, Icon) {
var preKey = pre[currentCol.key];
var afterKey = after[currentCol.key];
if (getMultiSorterValueFunc) {
preKey = getMultiSorterValueFunc(preKey);
afterKey = getMultiSorterValueFunc(afterKey);
preKey = getMultiSorterValueFunc(pre, currentCol);
afterKey = getMultiSorterValueFunc(after, currentCol);
}
var colSortFun = currentCol.sorter;
if (typeof colSortFun !== 'function') {

View File

@ -121,7 +121,7 @@ import 'bee-table/build/Table.css';
|width|宽度的特定比例根据列的宽度计算|String/Number|-|
|fixed| 当表水平滚动时此列将被固定true或'left'或'right'| true/'left'/'right'|-|
|sorter|前端列排序方法,只要列上有此属性就说明这列可排序。**注:默认是前端排序,排序方法书写时注意有些字段的值可能是undefined的情况需要转换成0**| function|-|
|getMultiSorterValue| 多列排序的时候,可以使用此方法得到单元格中显示的值,用来进行排序中的判断|Function(row)|-|
|getMultiSorterValue| 多列排序的时候,可以使用此方法得到单元格中显示的值,用来进行排序中的判断|Function(data, col)|-|
|sorterClick|排序的回调函数|function|-|
|render|cell的render函数有三个参数这个单元格的文本这行的记录这行的索引它返回一个对象{childrenvalueprops{colSpan1rowSpan1}} ==>'children'是这个单元格的文本props是这个单元格的一些设置可以设置单元格行/列合并。2.2.48及以后版本新增第四个参数options为column设置的属性|-|
|onCellClick|单击列的单元格时调用|Function(row, event)|-|

View File

@ -1,6 +1,6 @@
{
"name": "bee-table",
"version": "2.2.48-nc.1",
"version": "2.2.48-nc.2",
"description": "Table ui component for react",
"keywords": [
"react",

View File

@ -120,8 +120,8 @@ export default function sort(Table, Icon) {
let preKey = pre[currentCol.key];
let afterKey = after[currentCol.key];
if (getMultiSorterValueFunc) {
preKey = getMultiSorterValueFunc(preKey)
afterKey = getMultiSorterValueFunc(afterKey)
preKey = getMultiSorterValueFunc(pre, currentCol)
afterKey = getMultiSorterValueFunc(after, currentCol)
}
let colSortFun = currentCol.sorter;
if(typeof colSortFun !== 'function'){