Is it possible to make a whole cell or row linkable in datatables? I am using Metronic Vue demo7. Thank you!
Hi,
Currently, our datatables component doesn't support linkable rows. However, you can make rows linkable by redirecting users in the click event.
const router = useRouter();
onMounted(()=>{
// collect all table rows
document.querySelectorAll(".table-selector-class tbody tr").forEach(item => {
// add click event on row element
item.addEventListener("click", (e)=>{
// redirect user to the page
router.push("/your-route-path")
})
})
})
<style>
.table-selector-class tbody tr:hover {
background-color: var(--bs-primary-light);
cursor: pointer;
}
</style>