Skip to content

Commit 7309b3c

Browse files
committed
add getColumnByColkey method
1 parent 80e0a8e commit 7309b3c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/ve-table/src/util/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ export function getRowKey(rowData, rowKeyFieldName) {
2626
return result;
2727
}
2828

29+
/*
30+
* @getColumnByColkey
31+
* @desc get column by col key
32+
* @param {string} rowKeyFieldName - row key field name
33+
*/
34+
export function getColumnByColkey(colKey, colgroups) {
35+
if (colKey) {
36+
return colgroups.find((x) => x.key === colKey);
37+
}
38+
return null;
39+
}
40+
2941
/*
3042
* @getDomResizeObserverCompKey
3143
* @desc get dom resize observer comp key

0 commit comments

Comments
 (0)