Index: branches/5.3.x/core/admin_templates/js/grid_filters.js =================================================================== diff -u -N -r15902 -r16600 --- branches/5.3.x/core/admin_templates/js/grid_filters.js (.../grid_filters.js) (revision 15902) +++ branches/5.3.x/core/admin_templates/js/grid_filters.js (.../grid_filters.js) (revision 16600) @@ -82,14 +82,17 @@ $('#' + jq($form_name)).append($div); // set click handlers - $('#_mutlioptions_cb_' + $cur_index + '_all') - .click( - function ($e) { - MultiOptions.SelectAll($cur_index); - } - ) - .prop('checked', $options.length == $options.filter(':selected').length > 0); + var $select_all = $('#_mutlioptions_cb_' + $cur_index + '_all'), + $new_checked = $options.length === $options.filter(':selected').length; + $select_all.click(function ($e) { + MultiOptions.SelectAll($cur_index); + }); + + if ( $select_all.prop('checked') !== $new_checked ) { + $select_all.prop('checked', $new_checked).change(); + } + $('input._mutlioptions_cb_' + $cur_index).click( function ($e) { MultiOptions.ItemChecked($cur_index); @@ -136,17 +139,26 @@ // update "Select All" checkbox var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all'); var $options = $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all); + var $new_checked = $options.length === $options.filter(':checked').length; - $select_all.prop('checked', $options.length == $options.filter(':checked').length > 0); + if ( $select_all.prop('checked') !== $new_checked ) { + $select_all.prop('checked', $new_checked).change(); + } } MultiOptions.SelectAll = function(selector_index) { // set all checkbox to match "Select All" checkbox var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all'); var $checked = $select_all.prop('checked'); - $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all).prop('checked', $checked); + $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all).each(function () { + var $checkbox = $(this); + if ( $checkbox.prop('checked') !== $checked ) { + $checkbox.prop('checked', $checked).change(); + } + }); + // sync hidden field var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-]+)'); update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]);