code: function() {
              if (this.hasSelectAll()) {
                  var allBoxes = $("li:not(.multiselect-item):not(.filter-hidden) input:enabled", this.$ul);
                  var allBoxesLength = allBoxes.length;
                  var checkedBoxesLength = allBoxes.filter(":checked").length;
                  var selectAllLi  = $("li.multiselect-all", this.$ul);
                  var selectAllInput = selectAllLi.find("input");
  
                  if (checkedBoxesLength > 0 && checkedBoxesLength === allBoxesLength) {
                      selectAllInput.prop("checked", true);
                      selectAllLi.addClass(this.options.selectedClass);
                      this.options.onSelectAll();
                  }
                  else {
                      selectAllInput.prop("checked", false);
                      selectAllLi.removeClass(this.options.selectedClass);
                  }
              }
          }
docs: Updates the select all checkbox based on the currently displayed and selected checkboxes.