I have a table as part of a form for which users can click the header row to sort by that column (and click again to reverse order). The table also contains checkboxes, and clicking the checkbox in the header row checks or unchecks all checkboxes below.
However, there is also the case that the user may want to order by whether a checkbox is checked or unchecked. What is the best practice to enable this sort while also preserving the ability to check / uncheck all?