CRUD
CRUD copied to clipboard
[4.2.x] Allow to choose whether you show bulk checkbox
WHY
Perhaps people don't want a checkbox for every item. For example, maybe if you have a bulk delete and there is an active filter for including soft deletes, you don't want to "delete" it again
BEFORE - What was wrong? What was happening before this PR?
Every entry had a checkbox
AFTER - What is happening after this PR?
Every entry still has a checkbox, but you can choose to limit which ones should have it
HOW
How did you achieve that, in technical terms?
I added an optional callback function that you can create in your setupListOperation: $this->crud->bulkCallback = function($entry) { return true; } that should return true or false for each entry
Is it a breaking change or non-breaking change?
Non-breaking change
How can we test the before & after?
Add the aforementioned callback that would limit which entries have a checkbox
The inspection completed: No new issues
Cool feature! Thank you @zachweix , I see how this could be useful. I've moved it to 4.2.x (in a few weeks) because Antonio is working on a rewrite that might affect this in 4.2. I'll be back when that's done, thanks for the PR!
Sorry @zachweix , Antonio's changes there have made this impossible to merge. The checkbox blade file has changed A LOT. We are introducing a lot of customizations like this one now, so if you still like this and want it, please open a different PR for Backpack v6, happy to take a look and merge (a lot faster this time 😔).
Please don't let this discourage you. I'm shutting down my own PRs too, regularly, it's just the way things go. If you (or anybody else) think I'm wrong here and it does make sense to merge, that it's important for us to do so - let me know and we'll taken another look, re-open. I'm human, I make mistakes all the time.
Cheers!