• 
      

    Add constructor-level customization of columns and sorting in datagrids.

    Review Request #14818 — Created Feb. 16, 2026 and submitted — Latest diff uploaded

    Information

    Djblets
    release-5.x

    Reviewers

    Datagrids have historically allowed for custom column selection/ordering
    and sorting via HTTP GET query strings. This works great in the case
    where you want to display a standard datagrid page with user choices,
    but less so when you want to handle providing these options through
    other means.

    This change introduces new columns and sort arguments to the
    DataGrid constructor. These both take lists of strings, and behave the
    same way that the query string versions do. They can also take None,
    which will force usage of the datagrid defaults.

    This not only overrides (and disables) anything in the querystring, but
    also prevents both loading from and saving to the user profile.

    Unit tests pass.

    Tested with some in-progress code using specially-constructed datagrids,
    and verified I could define the columns and sort order.

    Commits

    Files