How can I make "Shift select multiple checkboxes" to the filament v3 table?
How can I make "Shift select multiple checkboxes" to the filament v3 table?
I have tried creating new custom.js file like this:
JS
document.addEventListener('DOMContentLoaded', function () {
const checkboxes = document.querySelectorAll('.inbox input[type="checkbox"]');
let last checked;
function handleCheck(e) {
let inBetween = false;
if (e.shiftKey && this.checked) {
checkboxes.forEach(checkbox => {
if (checkbox === this || checkbox === lastChecked) {
inBetween = !inBetween;
}
if (inBetween) {
checkbox.checked = true;
}
});
}
lastChecked = this;
}
checkboxes.forEach(checkbox => checkbox.addEventListener('click', handleCheck));
});
Ref: https://codepen.io/danielhoppener/pen/xxKVbey3 Replies
Hey there, I'm working on a PR for this, this is what I have so far. Feel free to give feedback, as this is my first PR: https://github.com/filamentphp/filament/pull/13074
GitHub
Feature: Shift click to select table records (like Gmail and Linear...
Description
Allow multiple records in tables to be selected using shift click as in Gmail or Linear. Was working on this for an app I'm building and saw #13070.
Alters the table Alpine compone...
Thank you for your response, I will check
Solution
It's now merged and released in the latest version of Filament