awake-maroonA
Refine3y ago
6 replies
awake-maroon

How to sort DataGrid of computed column?

One of my columns in the MUI x-DataGrid is a computed column. When I attempt to click the header to sort by the computed value, the table spins for a few seconds and returns an error message:
column table_name.column_name does not exist Error (status code: 42703)'

My computed column GridColDef looks like this:
                {
                    field: "profit",
                    headerName: "Profit",
                    type: "number",
                    renderCell: function render({row}) {
                        return (
                             {compute_profit_here}
                        );
                    },
                 }


Did I implement this computed column correctly?
How do I make the column sort naturally and bypass refine's magic dataProvider/queries/etc.?
Was this page helpful?