Skip to content

Commit

Permalink
fix(core/dataTable): correct horizontal scroll bar (ems-project#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidmattei authored Sep 11, 2023
1 parent 50a1648 commit f51754d
Show file tree
Hide file tree
Showing 33 changed files with 61,164 additions and 60,974 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{%- use '@EMSAdminUI/bootstrap5/form/forms.html.twig' -%}
{% trans_default_domain 'EMSCoreBundle' %}


<div class="table-responsive">
<table class="table table-condensed table-striped" data-datatable="{{ datatable.frontendOptions|json_encode|e('html_attr') }}">
<thead>
<table class="table table-condensed table-striped" data-datatable="{{ datatable.frontendOptions|json_encode|e('html_attr') }}" style="width: 100%;">
<thead>
<tr role="row">
{% if datatable.supportsTableActions %}
<th class="fit" data-orderable="false" data-name="_checkbox">
Expand All @@ -25,8 +23,8 @@
<th class="nowrap" data-orderable="false">{{ 'table.index.column.actions'|trans }}</th>
{% endif %}
</tr>
</thead>
<tbody>
</thead>
<tbody>
{% for line in datatable %}
<tr>
{% if datatable.supportsTableActions %}
Expand All @@ -44,13 +42,12 @@
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</tbody>
</table>
{% if datatable.supportsTableActions %}
<div class="btn-group">
{% for action in datatable.tableActions %}
{{ form_widget(attribute(form, action.name)) }}
{% endfor %}
</div>
{% endif %}
{% endif %}
4 changes: 4 additions & 0 deletions EMS/core-bundle/assets/css/_ems.scss
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,8 @@ div.core-js-progress {
text-align: left;

& i { padding-right: 10px;}
}

div.dataTables_scroll {
margin-bottom: 10px;
}
4 changes: 3 additions & 1 deletion EMS/core-bundle/src/Form/Data/TableAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ public function getFrontendOptions(): array
++$counter;
}
}
$options = [];
$options = [
'scrollX' => true,
];

if (null !== $columnIndex) {
$options['order'] = [[$columnIndex, $this->orderDirection]];
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit f51754d

Please sign in to comment.