Browse Source

Add doc about form javascript events

Emmanuel Vella 11 years ago
parent
commit
373eb50b0d
1 changed files with 14 additions and 2 deletions
  1. 14 2
      Resources/doc/reference/form_types.rst

+ 14 - 2
Resources/doc/reference/form_types.rst

@@ -222,9 +222,21 @@ btn_add and btn_catalogue:
   corresponding button. You can also specify a custom translation catalogue
   for this label, which defaults to ``SonataAdminBundle``.
 
+**TIP**: A jQuery event is fired after a row has been added (``sonata-admin-append-form-element``).
+You can listen to this event to trigger custom javascript (eg: add a calendar widget to a newly added date field)
+
+collection
+^^^^^^^^^^
+
+This bundle handle the symfony ``collection`` form type by adding:
+* an ``add`` button if you set the ``allow_add`` option to ``true``.
+* a ``delete`` button if you set the ``allow_delete`` option to ``true``.
+
+**TIP**: A jQuery event is fired after a row has been added (``sonata-admin-append-form-element``).
+You can listen to this event to trigger custom javascript (eg: add a calendar widget to a newly added date field)
+
 **TIP**: A jQuery event is fired after a row has been added (``sonata-collection-item-added``)
-or deleted (``sonata-collection-item-deleted``). You can bind to these events to trigger custom
-javascript imported into your templates (eg: add a calendar widget to a newly added date field)
+or deleted (``sonata-collection-item-deleted``). You can listen to these events to trigger custom javascript.
 
 FieldDescription options
 ^^^^^^^^^^^^^^^^^^^^^^^^