Skip to content

Update target grouping table#1408

Merged
jchate6 merged 12 commits into1111-build-htmx-table-widgetfrom
update_target_grouping_table
Feb 13, 2026
Merged

Update target grouping table#1408
jchate6 merged 12 commits into1111-build-htmx-table-widgetfrom
update_target_grouping_table

Conversation

@jchate6
Copy link
Copy Markdown
Contributor

@jchate6 jchate6 commented Feb 13, 2026

The excuse for this PR is to add an HTMX table to target groupings.
This also substantially re-works the docs, and changes some of the base htmx classes.
The motivation for this was to make the architecture and the docs more user friendly, extracting basic functions to the toolkit to make it easier to get started and make it more clear what extra features are supported.

I did not update the Targets table to use any of these simplification functions. They stand as good examples to doing it the "hard" way.

For the Target Groups Table, I did not include sharing. This will need to be added to retain functionality, but optional columns seemed like more work than I was willing to put in, and the goal for the (hopefully) near future is to add a standard "actions" drop down whenever checkboxes are included.

The docs could probably still use more internal references, but from the weeds it's pretty hard to see exactly where these should go.

Comments about the HTMX table:

  • It is difficult to add anything that isn't a model field to your table.
  • We should find some way to generalize sorting of non-field columns (I did this somewhat for model properties)
  • We need to show which column the table is sorted by from the outset
  • We need to have faded stand ins for the sortable icons to let people know the table is sortable. (up/Down arrows)
image

@jchate6 jchate6 requested a review from phycodurus February 13, 2026 07:31
@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Feb 13, 2026
(to the object's detail page) rather than being intercepted by HTMX. [3]_
(to the object's detail page) rather than being intercepted by HTMX. [2]_

See the example in `tom_targets/tables.py <https://github.com/TOMToolkit/tom_base/tree/dev/tom_targets>`_.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link can be made specific to the the relevant line number once this PR has been merged into the (more permanent) dev branch

)
)
return self._form
See the example in `tom_targets/views.py <https://github.com/TOMToolkit/tom_base/blob/dev/tom_targets/views.py>`_.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another link that could include a line number after the PR is merged

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Subclass ``HTMXTableFilterSet`` from ``tom_common.htmx_table``. The base
class provides a General Search text field (``query``) with debounced
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I"m not attached to query as the name of this field. Open to suggestions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better as general_search or something, but this conflicts with the method name, and I'm not going to worry about it right now.

@jchate6 jchate6 merged commit 5ecb723 into 1111-build-htmx-table-widget Feb 13, 2026
22 of 23 checks passed
@jchate6 jchate6 deleted the update_target_grouping_table branch February 13, 2026 22:47
@github-project-automation github-project-automation bot moved this from Needs Review to Merged (to dev) in TOM Toolkit Feb 13, 2026
@jchate6 jchate6 moved this from Merged (to dev) to Released in TOM Toolkit Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants