sortable_columns also now works with views

This commit is contained in:
Simon Willison 2018-08-05 17:29:23 -07:00
commit 5629aaca67
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
4 changed files with 42 additions and 18 deletions

View file

@ -121,6 +121,23 @@ This will restrict sorting of ``example_table`` to just the ``height`` and
You can also disable sorting entirely by setting ``"sortable_columns": []``
By default, database views in Datasette do not support sorting. You can use ``sortable_columns`` to enable specific sort orders for a view called ``name_of_view`` in the database ``my_database`` like so::
{
"databases": {
"my_database": {
"tables": {
"name_of_view": {
"sortable_columns": [
"clicks",
"impressions"
]
}
}
}
}
}
.. _label_columns:
Specifying the label column for a table