Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

Bulk update operation #135

Open margarizaldi opened 2 years ago

margarizaldi commented 2 years ago

In my opinion, bulk clone operation is less often needed than bulk update operation.

For example, in e-commerce admin panel, we always face a situation to select some rows then update their statuses from "processed" to "shipped", either using a modal or simple button to set the value(s).

Of course we can create a custom button, but shipping this feature into the package with a convenient syntax (free/pro doesn't matter) is always a good idea.

tabacitu commented 2 years ago

Thanks for the idea @margarizaldi . Duly noted.

It would be a pretty complex operation to do, though. So we're going to wait for more feedback on this. If a lot of people say they want it, we'll do it! We'll point more people here who express an interest. Also, anybody who sees this and thinks it's a good idea to build a Bulk Update operation, say something or add a reaction.

Cheers!

margarizaldi commented 2 years ago

@tabacitu Sure, though I think this should be one of the key feature of backpack pro version. 😎

tabacitu commented 2 years ago

On second thought, this might not be such a difficult operation to create. We could keep it simple, for it to work exactly like the BulkDelete operation... but when you click the "BulkEdit" button it would bring up a modal that shows one/more fields. If used, they'll ask "are you sure you want to update x items?" and run a validation.

Similar to what we're doing on the editable columns with the MinorUpdate operation.

I'll think about it a little bit more and get back to this.

margarizaldi commented 2 years ago

I imagine the setupBulkUpdateOperation method will look exactly the same as create/update operation (defining fields, validation, etc.). If the method exists, bulk update button will appear once rows are selected to initiate a bulk update modal form.