I have a column in my ExtJS grid that contains mixed values like:
700_john
700_harry
900_jack
andrew
701_kate
I want them to be sorted properly in ascending order, like this:
700_harry
700_john
701_kate
900_jack
andrew
But currently ExtJS sorts them incorrectly — it seems to treat numeric prefixes weirdly and the order becomes almost random (e.g. 700 values go first, 701 somewhere in the middle, and 900 ends up at the bottom).
I don’t want to change my global sorting logic for the whole app — I just need a custom sorter (or renderer) for this one column that handles numeric prefixes correctly before sorting alphabetically by the rest of the string.
What’s the best way to implement this in ExtJS? Ideally, I’d like to extract the number before _ (if any), sort by it numerically, and then by the string part