diff --git a/netbox/netbox/tables/tables.py b/netbox/netbox/tables/tables.py index b5e7715ba..cbcccdf92 100644 --- a/netbox/netbox/tables/tables.py +++ b/netbox/netbox/tables/tables.py @@ -1,5 +1,6 @@ from copy import deepcopy from functools import cached_property +from urllib.parse import urlencode import django_tables2 as tables from django.conf import settings @@ -191,6 +192,14 @@ class BaseTable(tables.Table): 'ordering': self.order_by, } + @property + def config_params(self): + return urlencode({ + 'object_type': ObjectType.objects.get_for_model(self.Meta.model).pk, + 'table': self.name, + **self.configuration, + }) + class NetBoxTable(BaseTable): """ diff --git a/netbox/templates/htmx/table.html b/netbox/templates/htmx/table.html index 5728789fa..376764cef 100644 --- a/netbox/templates/htmx/table.html +++ b/netbox/templates/htmx/table.html @@ -19,6 +19,9 @@ {# Include the updated object count for display elsewhere on the page #}
{{ table.rows|length }}
+ {# Include the updated "save" link for the table configuration #} + Save + {# Update the bulk action buttons with new query parameters #} {% if actions %}
diff --git a/netbox/templates/inc/table_controls_htmx.html b/netbox/templates/inc/table_controls_htmx.html index e312008c9..29a2c47c6 100644 --- a/netbox/templates/inc/table_controls_htmx.html +++ b/netbox/templates/inc/table_controls_htmx.html @@ -34,7 +34,7 @@ Toggle Dropdown