Replies: 1 comment
-
Just so I'm clear - you want a click on any column in the row, to toggle the Bulk Actions checkbox for that row? What you're doing at the moment, will result in a server-side call for your "public function selectRow", which will then cause a re-render. Doing it client-side is best, there are methods used internally that may be of use, as the Bulk Actions uses AlpineJS to determine what is part of the "selected" array. You could also just use straight JS to toggle the checkbox: $this->setTrAttributes(function($row, $index) {
return [
'x-on:click' => "document.querySelectorAll('[rowpk=\"".$row->{$this->getPrimaryKey()}."\"] input')[0].checked = !document.querySelectorAll('[rowpk=\"".$row->{$this->getPrimaryKey()}."\"] input')[0].checked",
];
}); However, using the built-in methods would be smoother! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been trying to figure out how to add a row to the bulk select when clicking on it.
So far I managed to get it somewhat working with the following:
Beta Was this translation helpful? Give feedback.
All reactions