Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- jQuery(document).ready(function ($) {
- $('#list_batch_checkbox').click(function () {
- $(this).closest('table').find("td input[type='checkbox']").attr('checked', $(this).is(':checked'));
- });
- $('.delete_link').click(function (e) {
- if (!confirm('{% trans from 'SonataAdminBundle' %}confirm_msg{% endtrans %}')) e.preventDefault();
- });
- });
- var secondary_action = {};
- </script>
- <div class="actions sonata-ba-list-actions">
- <select id="primary" name="action">
- {% for action, options in batchactions %}
- <option id="{{ 'action-' ~ action }}" value="{{ action }}">{{ options.label }}</option>
- <script type="text/javascript">
- $(document).ready(function () {
- {% if options.secondary is defined %}
- secondary_action['{{ action }}'] = '{% for key, value in options.secondary %}<option value="{{ key }}">{{ value }}</option>{% endfor %}';
- {% else %}
- secondary_action['{{ action }}'] = '';
- {% endif %}
- });
- </script>
- {% endfor %}
- </select>
- <script type="text/javascript">
- $(document).ready(function () {
- function fillSecondary() {
- var html = secondary_action[$('#primary').val()];
- $('#secondary').html(html);
- if (html != '') {
- $('#secondary-container').css('display', 'block');
- } else {
- $('#secondary-container').css('display', 'none');
- }
- return true;
- }
- fillSecondary();
- $('#primary').change(function () {
- fillSecondary();
- });
- });
- </script>
- <div id="secondary-container" style="display: none;">
- <select name="secondary" id="secondary">
- </select>
- </div>
- <label>
- <input type="checkbox" name="all_elements"/>
- {% trans from 'SonataAdminBundle' %}all_elements{% endtrans %}
- </label>
- <input type="submit" class="btn primary" value="{% trans from 'SonataAdminBundle' %}btn_batch{% endtrans %}"/>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement