Commit graph

23 commits

Author SHA1 Message Date
TomJGooding
fe5b37a327
docs(datatable): remove outdated cursor info (#5355) 2024-12-09 10:19:14 +00:00
Charles Merriam
b5e165f533
Improvements to Widget DataTable documentation (#4706)
* Preamble.  Mention commonly searched for capabilities missing, e.g., formatting and filtering.

* Clarify zebra_stripes as using alternating styles.

* Expand Cursors section to mention None type of cursor, clarify keyboard and mouse events, and that row indices start at one.  Expand example for No Cursor option.

Also minor typos to previous two commits (preamble wording and zebra stripes).

* Expand sorting section for clarity.

Minor typos in Labeled Rows and Cursors sections.

* In Keys section, mention functions taking coordinates.

Fix typo in Sorting section.

* Minor changes

---------

Co-authored-by: Darren Burns <darrenb900@gmail.com>
2024-07-10 16:38:05 +01:00
Josh Duncan
4f95d30619
DataTable sort by function (or other callable) (#3090)
* DataTable sort by function (or other callable)

The `DataTable` widget now takes the `by` argument instead of `columns`, allowing the table to also be sorted using a custom function (or other callable). This is a breaking change since it requires all calls to the `sort` method to include an iterable of key(s) (or a singular function/callable). Covers #2261 using [suggested function signature](https://github.com/Textualize/textual/pull/2512#issuecomment-1580277771) from @darrenburns on PR #2512.

* argument change and functionaloty update

Changed back to orinal `columns` argument and added a new `key` argument
which takes a function (or other callable). This allows the PR to NOT BE
a breaking change.

* better example for docs

- Updated the example file for the docs to better show the functionality
of the change (especially when using `columns` and `key` together).
- Added one new tests to cover a similar situation to the example
  changes

* removed unecessary code from example

- the sort by clicked column function was bloat in my opinion

* requested changes

* simplify method and terminology

* combine key_wrapper and default sort

* Removing some tests from DataTable.sort as duplicates. Ensure there is test coverage of the case where a key, but no columns, is passed to DataTable.sort.

* Remove unused import

* Fix merge issues in CHANGELOG, update DataTable sort-by-key changelog PR link

---------

Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>
Co-authored-by: Darren Burns <darrenb900@gmail.com>
2023-10-31 13:14:47 +00:00
Dave Pearson
8f9eab1e10
Fix a link in the DataTable docs
Noticed this in passing.
2023-10-05 14:50:01 +01:00
TomJGooding
3d7f5e2c74 docs: add datatable supplementary classes 2023-09-11 13:16:07 +01:00
TomJGooding
2d0266550e
feat(datatable): add remove column method (#2899)
* feat(datatable): add remove column method

* add basic unit test

* improve test by checking row data

* update datatable docs

* update changelog
2023-07-12 10:59:25 +01:00
Rodrigo Girão Serrão
c4eda48a0a
Tweaks to DataTable docs. (#2481)
* Tweaks to DataTable docs.

Related PRs: #2479.

* Fix link.
2023-05-04 14:55:14 +01:00
darrenburns
5246282c22
Improving data table documentation (#2279)
* Improving data table documentation

* More info on DataTable

* Add note on retrieving cursor coordinate

* Add note on DataTable supporting more than just strings

* Add note on cell styling and justifying - common question

* Slight rewording

* Explaining what "row labels" are.

* Update docs/widgets/data_table.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Update docs/widgets/data_table.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Update docs/widgets/data_table.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Update docs/widgets/data_table.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/widgets/data_table.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/widgets/data_table.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/widgets/data_table.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/widgets/data_table.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Improve data table fixed rows/columns docs

* Update some examples

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-13 14:09:19 +01:00
Will McGugan
2244b1161e
api docs (#2240)
* api docs

* more docstrings

* logs

* docs shakeup

* fix notes, added intro to all apis

* Remove defaults to

* add note to events

* note

* use fira code
2023-04-08 15:35:49 +01:00
Will McGugan
f5e779c4c4
tabbed content widget (#2059)
* tabbed content widget

* TabbedContent widget and docs

* missing docs

* fix active

* doc fix

* test fix

* additional test

* test for render_str

* docstring

* changelog

* doc update

* changelog

* fix bad optimization

* Update docs/widgets/tabbed_content.md

Co-authored-by: Dave Pearson <davep@davep.org>

* fix for empty initial

* docstrings

* Update src/textual/widgets/_content_switcher.py

Co-authored-by: Dave Pearson <davep@davep.org>

* docstring

* remove log

* permit nested tabs

* renamed TabsCleared to Cleared

* added tests, fix types on click

* tests

* fix broken test

* fix for nested tabs

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-03-18 10:38:41 +00:00
Will McGugan
df1edb087c
Merge pull request #1788 from Textualize/datatable-select-headers
DataTable - Message emitted when header selected
2023-02-14 16:42:01 +00:00
Darren Burns
36a9214d7f
Update reactive names in DataTable reference docs 2023-02-14 15:29:05 +00:00
Darren Burns
49b78daa04
Update docs to include DataTable.HeaderSelected 2023-02-14 15:18:32 +00:00
Rodrigo Girão Serrão
ef779d71dd Add bindings and component classes to reference pages. 2023-01-25 15:19:16 +00:00
Darren Burns
be45db4573
Use autodoc for DataTable Messages reference 2023-01-17 13:00:01 +00:00
Darren Burns
23eb13d12d
Some DataTable doc updates, rename Coord -> Coordinate and extract to module 2023-01-17 11:06:21 +00:00
Darren Burns
f327f1d2af
Small datatable docs rewording 2023-01-17 10:11:19 +00:00
Darren Burns
9bc93cd683
Small datatable docs rewording 2023-01-17 10:06:39 +00:00
Darren Burns
2814e1f93c
Documentation updates 2023-01-16 10:50:41 +00:00
Darren Burns
c6418e5e20
Snapshot testing data table, checkbox interactions 2022-10-24 12:14:52 +01:00
Will McGugan
8b6ca1b609 typo 2022-10-06 16:28:22 +01:00
Will McGugan
851cc6ff95 flexible columns, table docs 2022-10-06 11:12:22 +01:00
Will McGugan
432db21512 app basics and doc structure 2022-09-04 20:40:12 +01:00