How to autofit height after re-initialization?
How to autofit height after re-initialization?
Anonymouse703
Posts: 18Questions: 8Answers: 0
When I store/update a record the height of the table is not fit of the data in the table.
document.addEventListener('DOMContentLoaded', function () {
let table = new DataTable('#permissionTable');
});
document.addEventListener("DOMContentLoaded", () => {
Livewire.hook('element.updated', (el, component) => {
$("#permissionTable").DataTable().destroy();
$('#permissionTable').DataTable({
responsive: true,
paging : true,
destroy : true,
scrollY: 300,
scrollY:'50vh',
});
})
});
window.livewire.on('closePermissionModal', () => {
$('#permissionModal').modal('hide');
$('#permissionTable').DataTable();
});
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin