Skip to content

Commit

Permalink
TreeTable: call customer sortFunction for column set as sortField (#6436
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MBelniak authored Apr 23, 2024
1 parent 1d30336 commit 5a2e4e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/lib/treetable/TreeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,13 @@ export const TreeTable = React.forwardRef((inProps, ref) => {
const filters = (localState && localState.filters) || getFilters();
const sortField = (localState && localState.sortField) || getSortField();
const multiSortMeta = (localState && localState.multiSortMeta) || getMultiSortMeta();
const columns = getColumns();
const sortColumn = columns.find((col) => getColumnProp(col, 'field') === sortField);

if (sortColumn) {
columnSortable.current = getColumnProp(sortColumn, 'sortable');
columnSortFunction.current = getColumnProp(sortColumn, 'sortFunction');
}

if (ObjectUtils.isNotEmpty(filters) || props.globalFilter) {
data = filterLocal(data, filters);
Expand Down

0 comments on commit 5a2e4e7

Please sign in to comment.