home / docs / sections

sections: configuration:table-configuration-sortable-columns

This data as json

id page ref title content breadcrumbs references
configuration:table-configuration-sortable-columns configuration table-configuration-sortable-columns   Datasette allows any column to be used for sorting by default. If you need to control which columns are available for sorting you can do so using sortable_columns : [[[cog config_example(cog, textwrap.dedent( """ databases: mydatabase: tables: example_table: sortable_columns: - height - weight """).strip() ) ]]] [[[end]]] This will restrict sorting of example_table to just the height and weight columns. You can also disable sorting entirely by setting "sortable_columns": [] You can use sortable_columns to enable specific sort orders for a view called name_of_view in the database my_database like so: [[[cog config_example(cog, textwrap.dedent( """ databases: my_database: tables: name_of_view: sortable_columns: - clicks - impressions """).strip() ) ]]] [[[end]]] ["Configuration", null, "Table configuration"] []
Powered by Datasette · Queries took 6.421ms