This website version is not maintained anymore
Up to date documentation is available in Symfony 3.x website (see the dropdown menu above).
Use hide_useless_buttons
option to display or not the up button on the first item, and the down button on the last one.
This can be useful if you want to style useless buttons by yourself, instead of display:none
.
Test it live:
Value :a
Value :b
Value :c
Code used:
<script type="text/javascript"> $('.form-collection').collection({ hide_useless_buttons: false }); $('#test-it').on('click', function() { // only useful for the demo $('.collection-up, .collection-down').css('display', ''); $('.form-collection').collection({ hide_useless_buttons: $('#test-it').is(':checked') }); }); </script>