Skip to content

Commit

Permalink
hide column name prefixed by "_"
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrombez authored Dec 12, 2023
1 parent 30bb030 commit 365248e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/Resources/views/theme/bootstrap5/datagrid-table.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
{% endif %}

<th {% if th_class is not empty %}class="{{ th_class }}"{% endif %}>
{% if column.sortable is not null %}
{% set sortUrl = path(
grid.pagination.route,
grid.pagination.params|merge({
'sort_by': column.sortable,
'sort_order': app.request.get('sort_order') == 'ASC' ? 'DESC' : 'ASC'
})
) %}
<a href="{{ sortUrl }}" title="{{ 'Sort'|trans({}, 'KibaticDatagridBundle') }}">{{ column.name }}</a>
{% else %}
{{ column.name }}
{% if not (column.name starts with '_') %}
{% if column.sortable is not null %}
{% set sortUrl = path(
grid.pagination.route,
grid.pagination.params|merge({
'sort_by': column.sortable,
'sort_order': app.request.get('sort_order') == 'ASC' ? 'DESC' : 'ASC'
})
) %}
<a href="{{ sortUrl }}" title="{{ 'Sort'|trans({}, 'KibaticDatagridBundle') }}">{{ column.name }}</a>
{% else %}
{{ column.name }}
{% endif %}
{% endif %}
</th>
{% endfor %}
Expand Down

0 comments on commit 365248e

Please sign in to comment.