Skip to content
Snippets Groups Projects
Commit 1ca3ed70 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Fix responsiveness in on the demo page

For some reason setting autoWidth and setting the table width to 100% makes it work.
Only on the demo page though and not in the app, but it's a start.
parent fc30bc80
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,7 @@ class DataTableView extends LitElement { ...@@ -88,7 +88,7 @@ class DataTableView extends LitElement {
this.table = $(this.shadowRoot.querySelector('table')).DataTable({ this.table = $(this.shadowRoot.querySelector('table')).DataTable({
destroy: true, destroy: true,
autoWidth: false, autoWidth: true,
language: lang_obj, language: lang_obj,
paging: this.paging, paging: this.paging,
searching: this.searching, searching: this.searching,
...@@ -116,17 +116,14 @@ class DataTableView extends LitElement { ...@@ -116,17 +116,14 @@ class DataTableView extends LitElement {
] ]
}); });
try {
new $.fn.dataTable.Responsive(this.table, {
details: true
});
} catch (e) {
// XXX: it throws, but it still works
}
this.data = data; this.data = data;
this.table.clear().rows.add(this.data).draw(); this.table.clear().rows.add(this.data).draw();
new $.fn.dataTable.Responsive(this.table, {
details: true
});
} }
update(changedProperties) { update(changedProperties) {
...@@ -152,9 +149,14 @@ class DataTableView extends LitElement { ...@@ -152,9 +149,14 @@ class DataTableView extends LitElement {
border-radius: var(--vpu-border-radius); border-radius: var(--vpu-border-radius);
background: transparent; background: transparent;
} }
.export-btn { .export-btn {
margin-bottom: .6rem; margin-bottom: .6rem;
} }
:host {
display: block;
}
`; `;
} }
...@@ -171,7 +173,7 @@ class DataTableView extends LitElement { ...@@ -171,7 +173,7 @@ class DataTableView extends LitElement {
<style> <style>
${this.cssStyle} ${this.cssStyle}
</style> </style>
<div><table></table></div> <div><table width="100%"></table></div>
`; `;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment