Q:

jQuery UI Multiselect Next - onChange - remove all, add all

I have jQuery UI Multiselect Next http://quasipartikel.at/multiselect_next I want to fire an event whenever the selection changes in any way.
This example works:
<script type="text/javascript">

$(function(){
$("#countries").multiselect();          
$('#countries').multiselect({ selected: function(event, ui) {change(); } });
$('#countries').multiselect({ deselected: function(event, ui) {change(); } });
});         

function change(){
alert('CHANGE');
}

</script>

When I move an element from a list, the function change() is called.
The main problem is when I press "Remove all" or "Add all", because the function is called many times (the number of elements).
Is possible call the function change() only one time, when I press "Remove all" or "Add all"?
Thanks.

A:

I found the solution:
Open ui.multiselect.js
Add following line to selectAll function:
this.element.trigger('change');
Add following line to selectNone function {
this.element.trigger('change');
Add following line to stop function
that.element.trigger('change');
HTML:
<script type="text/javascript">
    $(function(){       
        $("#countries").multiselect();          
        $('#countries').bind('change', function() {alert('Change'); });
        });
</script>

