3

I am using this cool Multiple Select plugin

Please look at "The Position" options. I would need to display either 1 text or 5 of 12 selected.

so If I only select 1 option then display that option if I select more than 1 then just state 2 of 12 are selected.

It seems that the default here is set to 4 and I need to override this.

How can I change the default value?

Here is my code

$(function(){                                           
   $(".multipleSelectMenuMask").multiselect({
   enableFiltering: true,
   enableCaseInsensitiveFiltering: true,
   selectedClass: null,
   nonSelectedText: "Select an option",
   includeSelectAllOption: true,
   buttonWidth: "100%",
   maxHeight: 250
   });
});
Jaylen
  • 39,043
  • 40
  • 128
  • 221

4 Answers4

2

I figured out the problem.

I am using bootstrap-multiselect not Multiple Select plugin

the option is

numberDisplayed
Jaylen
  • 39,043
  • 40
  • 128
  • 221
1

use Bootstrap multiselect here

$(".example-class-multiselect").multiselect({
    nonSelectedText: "Select an option",
    allSelectedText: "Selected all",
    nSelectedText  : "Selected",
    //...
});
Alexandru Sirbu
  • 179
  • 1
  • 10
0

Take a look at constructor http://wenzhixin.net.cn/p/multiple-select/docs/#constructor

minimumCountSelected

Type: int

countSelected will be shown only if more than X items where selected.

By default this option is set to 3.

Ragnar
  • 4,393
  • 1
  • 27
  • 40
0

Bower get not last version of plugin. Check your sources:

Line 245: } else if (selects.length > this.options.minumimCountSelected && this.options.countSelected) {

and

Line 443: minumimCountSelected: 3,

minUmIm

Now you can change option name to minumimCountSelected and temporary fix it in version 1.1.0.

Apache
  • 105
  • 1
  • 6