diff --git a/docs/examples/widgets/data_table_sort.py b/docs/examples/widgets/data_table_sort.py index 73669601be..d88223b9af 100644 --- a/docs/examples/widgets/data_table_sort.py +++ b/docs/examples/widgets/data_table_sort.py @@ -1,7 +1,6 @@ from rich.text import Text from textual.app import App, ComposeResult -from textual.events import Click from textual.widgets import DataTable, Footer ROWS = [ @@ -81,18 +80,6 @@ def action_sort_by_country(self) -> None: reverse=self.sort_reverse("country"), ) - def on_data_table_header_selected(self, event: Click) -> None: - """Sort `DataTable` items by the clicked column header.""" - - def sort_by_plain_text(cell): - return cell.plain if isinstance(cell, Text) else cell - - column_key = event.column_key - table = self.query_one(DataTable) - table.sort( - column_key, key=sort_by_plain_text, reverse=self.sort_reverse(column_key) - ) - app = TableApp() if __name__ == "__main__":