Allow datagrid columns to provide a custom sort field.
Review Request #5612 — Created March 11, 2014 and submitted — Latest diff uploaded
Datagrid column sorting relied on the
db_field
attribute of a Column,
but if a column needed to dynamically compute which field to use, it was
pretty much out of luck without resorting to hacks.Instead, we now use
get_sort_field()
, which returns the field used for
sorting. This defaults todb_field
, but can be overridden by subclasses.
Tested sorting of standard fields.
Used this for the review request ID field fix in Review Board, which
suddenly was able to be sorted correctly, both on global sites and
Local Sites.