This website version is not maintained anymore
Up to date documentation is available in Symfony 3.x website (see the dropdown menu above).
Use before_init
and after_init
, options to set a callback before or after collection
initialization.
Those callbacks will receive the current collection
as argument.
Your callback doesn't require to return something.
Value :a
Value :b
Value :c
Code used:
<script type="text/javascript"> $('#demo').click(function() { $(this).remove(); $('.form-collection').collection({ before_init: function(collection) { alert("As you can see, there are no buttons yet..."); }, after_init: function(collection) { alert("Look! Now there are!!"); } }); }); </script>