{% if search %} {% endif %} {% if loading %}
{% else %} {% if selectable %} {% endif %} {% for col in columns %} {{ col.label }} {% if sort_by == col.key %} {% if sort_desc %}↓{% else %}↑{% endif %} {% endif %} {% endfor %} {% for row in rows %} {% comment %} #1111: row-level navigation. row_click_event fires a djust event (LiveView-idiomatic, preferred); row_url is a static fallback that uses dataset+JS to navigate without LiveView routing. The data-table-row-clickable marker class wires up keyboard activation (Enter / Space) and a nested-control guard (clicks inside / {% endif %} {% for col in columns %} {% comment %} #1110: link column type. col.link names a key in the same row dict that holds the href; col.link_class is an optional CSS class on the . Falls through to plain text when col.link is unset, preserving pre-#1110 behavior. {% endcomment %} {% endfor %} {% empty %} {% endfor %}
{% if col.link %}{{ row|dictsort:col.key|first }}{% else %}{{ row|dictsort:col.key|first }}{% endif %}
{% if empty_icon %}
{{ empty_icon }}
{% endif %}

{{ empty_title|default:"No data" }}

{% if empty_description %}

{{ empty_description }}

{% endif %}
{% if paginate and total_pages > 1 %} {% elif total_pages > 1 %} {# Backward-compatible pagination using prev_event/next_event #}
{{ page }} / {{ total_pages }}
{% endif %} {% endif %} {% if row_click_event or row_url %} {% comment %} #1111: auto-load the row-click handler when row navigation is enabled. Hardcoded /static/ prefix (default STATIC_URL). Works for the default Django configuration without requiring `{% load static %}` (which a bare `Engine()` test renderer can't resolve). Sites with a custom STATIC_URL can override `djust_components/table.html` via Django's standard template-customization mechanism — drop a copy in their own templates dir with their `{% static %}` resolution. Defer attribute → loads after parsing; the JS module is idempotent if multiple data_tables on one page each emit this script tag. {% endcomment %} {% endif %}