Add a checkbox on each element of a list to perform a status update

32 views
Skip to first unread message

David Z

unread,
Mar 6, 2014, 4:01:58 AM3/6/14
to symfony2adm...@googlegroups.com
Hello all,

I'm beginning to use Admingenerator to display a list of orders, and i wish to add the following behaviour :

- Add a checkbox on each line, so each order can be selected
- Add a form above the list with a <select> element containing a list of statuses and a "Update" button.
- The goal is to allow user to select some orders by checking their checkbox and then choose a status, to update these orders with the chosen status

I achieved to add a form by extending getAdditionalRenderParameters() method in my List Controller in order to return me a Form object and then displaying it by adding some code in the "index.html.twig" file of my List

But how to display the checkbox next to each order of my list ? Is there a way to include them in the form i created ?

Thank you in advance for your advices !

David



Cédric Lombardot

unread,
Mar 6, 2014, 10:50:29 AM3/6/14
to Symfony2 Admingenerator bundles support for users
I i understand what you want to do it s one batch action ? Eg delete all selected 


Cedric



--
--
You received this message because you are subscribed to the Google
Groups "Symfony2 Admingenerator bundles support for users" group.
To post to this group, send email to
symfony2adm...@googlegroups.com
To unsubscribe from this group, send email to
symfony2admingene...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/

---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

David Z

unread,
Mar 7, 2014, 11:24:00 AM3/7/14
to symfony2adm...@googlegroups.com
Thanks Cedric that's what i needed !

I have just another question, i added 4 batch actions corresponding to 4 status of my entity.When selecting a status it performs an update on selected entities status as i wanted.
But the display is different from the demo site :
- In the demo site a list of batch actions is displayed with an "Execute" button next to it.
- In my case only the list of batch actions is displayed and no "Execute" buttons. The action is performed as soon as i select an action on the list.

Is there an easy way to display this "Execute" button and launch the batch action only when i click on this button ?


Le jeudi 6 mars 2014 16:50:29 UTC+1, cédric LOMBARDOT a écrit :
I i understand what you want to do it s one batch action ? Eg delete all selected 


Cedric

2014-03-06 10:01 GMT+01:00 David Z <dvdz...@gmail.com>:
Hello all,

I'm beginning to use Admingenerator to display a list of orders, and i wish to add the following behaviour :

- Add a checkbox on each line, so each order can be selected
- Add a form above the list with a <select> element containing a list of statuses and a "Update" button.
- The goal is to allow user to select some orders by checking their checkbox and then choose a status, to update these orders with the chosen status

I achieved to add a form by extending getAdditionalRenderParameters() method in my List Controller in order to return me a Form object and then displaying it by adding some code in the "index.html.twig" file of my List

But how to display the checkbox next to each order of my list ? Is there a way to include them in the form i created ?

Thank you in advance for your advices !

David



--
--
You received this message because you are subscribed to the Google
Groups "Symfony2 Admingenerator bundles support for users" group.
To post to this group, send email to
symfony2adm...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/

---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingenerator+unsub...@googlegroups.com.

Cédric Lombardot

unread,
Mar 7, 2014, 12:40:22 PM3/7/14
to Symfony2 Admingenerator bundles support for users
Hi,

The demo is not totally up to date.


Can you try to comment it in your js. If its works, we could think to make an issue or a PR to customize the remove or not of this button

Cedric



For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/

---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Z

unread,
Mar 11, 2014, 6:41:48 AM3/11/14
to symfony2adm...@googlegroups.com
Hi Cedric,

Commenting the removal instruction display the button, but in the case we want to use a submit button, the  __onSelect function must also be disabled as it submits the form on each change before clicking on the button.

David

For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/

---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingenerator+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message because you are subscribed to the Google
Groups "Symfony2 Admingenerator bundles support for users" group.
To post to this group, send email to
symfony2adm...@googlegroups.com
To unsubscribe from this group, send email to
symfony2admingenerator+unsub...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/

---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingenerator+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cédric Lombardot

unread,
Mar 11, 2014, 6:51:22 AM3/11/14
to Symfony2 Admingenerator bundles support for users
Yes of course, could you open a PR or at least an issue to make it configurable 


in function of the generator.yml config setted

Cedric



For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/

---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages