Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

Support for mass actions (batch) #5

Open
sstok opened this issue May 18, 2015 · 7 comments
Open

Support for mass actions (batch) #5

sstok opened this issue May 18, 2015 · 7 comments
Labels

Comments

@sstok
Copy link
Contributor

sstok commented May 18, 2015

The action configuration is kept separate from the actual execution of the action (handler).

@sstok sstok added the Feature label May 18, 2015
@cordoval
Copy link
Contributor

hmm, I need to right now add action buttons column, how to do it? please urgent @sstok I am stumped

@cordoval
Copy link
Contributor

I sent you a gist over skype, please check asap @sstok 👍

@sstok
Copy link
Contributor Author

sstok commented Jun 23, 2015

https://github.com/rollerworks/rollerworks-datagrid/blob/master/tests/DatagridPerformanceTest.php#L56-L76 shows to add action links for a record.
Symfony route generation support is coming.

Mass actions (select multiple records) "is" possible but I haven't figured out a good way to handle this.
We can use the Datagrid::bind() method which was actually meant for this, but its a challenge to get this without to much boilerplate code.

I will be completely available tomorrow 👍

@cordoval
Copy link
Contributor

I don't need mass actions but just regular actions i guess. This helps a bit, thanks, going to try to figure it out myself 👴

@cordoval
Copy link
Contributor

solved it @sstok thanks 👍 see you tomorrow first time 👴

@cordoval
Copy link
Contributor

@sstok one last question, where is the %d value of the placeholdr coming from and how can i provide it?

@sstok
Copy link
Contributor Author

sstok commented Sep 27, 2015

Technical note:

Handle batch operations using the Command pattern.
Select rows (or all) and action, the Delete action dispatches a DeleteSelectedRows(selectedRowsData) command, creating of the actual command is done by a Closure.

Checking if the operation is legal is something the Command handler must do, for the sake of DX the command handler can throw FailedBatchOperation exceptions which are converted to error messages (see RollerworksSearch for implementation).

Batch operations should not change the state of the datagrid, but instead re-render the complete datagrid (reload the page); as checking all rows is to slow.

The selectedRowsData information is provided by the field_mapping option.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants