ehynds/jquery-ui-multiselect-widget — Issue #212: Disabled Checkboxes Create Errors in IE [solution posted]
Author: vkman
Created: 2012-01-26 15:49:15+00:00
State: open

When an optgroup is clicked that has no enabled checkboxes, IE throws the following error:
"Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."

"Select All" and "Select None" functionality throws errors as well if all checkboxes within an optgroup are disabled.

I have modified the code in three places to prevent these errors. This code assumes that selecting and de-selecting disabled checkboxes is not allowed.

Solution as a git patch here: https://gist.github.com/1683322

---------
*Note: If it is desired to have the select all or none functionality affect disabled checkboxes, you can override this behavior in the widget's "checkAll" and "uncheckAll" event handlers something like the following:

function uncheckAllHandler(e) {
var multiselect = $j(e.target);
var disabledOptions = multiselect.find('option:disabled');
disabledOptions.removeAttr('disabled').removeAttr('selected'); //.attr('selected', 'selected'); for checkAllHandler
disabledOptions.attr('disabled','disabled');
multiselect.multiselect('refresh');
}