Black Lives Matter. Please consider donating to Black Girls Code today.

Native sorting on DataTable

I have a dataframe being piped into a DataTable and the sorting function appears to try to do stuff but it fails still, see e.g.


vs


So it is changing the order…just not correctly (I am sorting on ‘expected_net’)

I am specifying the types in the columns by looking at the python type of the elements in the first row and if its a str i return ‘text’, otherwise ‘numeric’ (this fixed a filtering issue where it seemed to think everything was a string).

I also had a look at the issues raised by others about needing to add a dummy callback but didn’t understand what the input/output should be, plus it seemed like in that case no row re-ordering was happening at all, in contrast to this case.

Any ideas?

Ah…i think i found the issue: the sorting toggles are actually on the LHS not the RHS so i wasn’t sorting by what i thought i was sorting by