Skip to content

Sorting Master List Does NOT Keep Detail Below Master Row #3394

Closed Answered by AYColumbia
AYColumbia asked this question in Q&A
Discussion options

You must be logged in to vote

I think I have this finally resolved. I did some more digging into the data grid guts in the demo and source code and did find a good approach with sorting use a getComparator function, I followed that pattern (found it in CommonFeatures.tsx under website\demos) and it seems to be working fine so far. I had to tune it a bit to support my columns and data types but so far so good. My sortedRows function now looks like this:

    const sortedRows = useMemo(() =>
    {
        if (gridData.length && sortColumns.length)
        {
            const { columnKey, direction } = sortColumns[0];
            setSortDirection(direction === appEnums.sortOrder.ascending ? appEnums.sortOrder.descending :…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by AYColumbia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant