mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
sortable_columns also now works with views
This commit is contained in:
parent
4ac9132240
commit
5629aaca67
4 changed files with 42 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue