philiplb / CRUDlex

CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages
https://philiplb.de/crudlex/
MIT License
109 stars 23 forks source link

Offer a checkbox on the listpage for mass manipulation #70

Open philiplb opened 7 years ago

philiplb commented 7 years ago

including a "select all" checkbox on top and bottom for the whole page. The first use case would be to delete the selected items.

philiplb commented 7 years ago

From https://github.com/philiplb/CRUDlex/issues/84:

Hello, in my company I implemented an ad-hoc "Batch operations" feature, and I'm thinking about backporting it to crudlex

In my case we wanted to delete all selected entries, but that could be extended for example to have a CSV export

image

What could be a good api for this?

first draft in pseudo-code

$app['crud']->addBatchOperation(new MyCrudlexBatchOperation())
class MyCrudlexBatchOperation extends BatchOperation
   fun support(EntityDefinition definition) => true or false
   fun label => "CSV Export"
   fun handle(EntityDefinition definition, List<Entity> entities) ---> do the csv export