Skip to content

Commit 4aacbd0

Browse files
committed
update
1 parent c060a8b commit 4aacbd0

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/hooks/useSearch.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ const useSearch = (props, tableManager) => {
5151
for (let index = 0; index < cols.length; index++) {
5252
const currentColumn = cols[index];
5353
const value = currentColumn.getValue({
54+
tableManager,
5455
value: item[key],
5556
column: currentColumn,
5657
rowData: item,
5758
});
5859
isValid = currentColumn.search({
5960
value: value?.toString() || "",
6061
searchText: searchApi.validSearchText,
61-
rowData: item,
6262
});
6363

6464
if (isValid) break;
@@ -72,7 +72,7 @@ const useSearch = (props, tableManager) => {
7272

7373
return rows;
7474
},
75-
[columns, searchApi.validSearchText]
75+
[columns, searchApi.validSearchText, tableManager]
7676
);
7777

7878
return searchApi;

src/hooks/useSort.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ const useSort = (props, tableManager) => {
4141
rows = [...rows];
4242
rows.sort((a, b) => {
4343
const aVal = cols[sortApi.sort.colId].getValue({
44+
tableManager,
4445
value: a[cols[sortApi.sort.colId].field],
4546
column: cols[sortApi.sort.colId],
47+
rowData: a,
4648
});
4749
const bVal = cols[sortApi.sort.colId].getValue({
50+
tableManager,
4851
value: b[cols[sortApi.sort.colId].field],
4952
column: cols[sortApi.sort.colId],
53+
rowData: b,
5054
});
5155

5256
if (cols[sortApi.sort.colId].sortable === false) return 0;
@@ -60,7 +64,7 @@ const useSort = (props, tableManager) => {
6064

6165
return rows;
6266
},
63-
[sortApi.sort, columns]
67+
[sortApi.sort, columns, tableManager]
6468
);
6569

6670
sortApi.toggleSort = (colId) => {

0 commit comments

Comments
 (0)