Commit 7ee176a7 authored by davidstutz's avatar davidstutz

Added option for #466 - although this may be handled easier by directly...

Added option for #466 - although this may be handled easier by directly modifying the buttonText option!
parent 07398c05
...@@ -198,8 +198,13 @@ ...@@ -198,8 +198,13 @@
return this.nonSelectedText; return this.nonSelectedText;
} }
else if (this.allSelectedText && options.length == $('option', $(select)).length) { else if (this.allSelectedText && options.length == $('option', $(select)).length) {
if (this.selectAllNumber) {
return this.allSelectedText + ' (' + options.length + ')';
}
else {
return this.allSelectedText; return this.allSelectedText;
} }
}
else if (options.length > this.numberDisplayed) { else if (options.length > this.numberDisplayed) {
return options.length + ' ' + this.nSelectedText; return options.length + ' ' + this.nSelectedText;
} }
...@@ -306,6 +311,7 @@ ...@@ -306,6 +311,7 @@
selectAllText: ' Select all', selectAllText: ' Select all',
selectAllValue: 'multiselect-all', selectAllValue: 'multiselect-all',
selectAllName: false, selectAllName: false,
selectAllNumber: true,
enableFiltering: false, enableFiltering: false,
enableCaseInsensitiveFiltering: false, enableCaseInsensitiveFiltering: false,
enableClickableOptGroups: false, enableClickableOptGroups: false,
......
...@@ -1595,6 +1595,47 @@ ...@@ -1595,6 +1595,47 @@
}); });
}); });
</script> </script>
</pre>
</div>
</td>
</tr>
<tr>
<td>
<code>selectAllNumber</code>
</td>
<td>
<p>
If set to <code>true</code> (default), the number of selected options will be shown in parantheses when all options are seleted. The below example shows the behavior of the selectalloption with <code>selectAllNumber</code> set to <code>false</code>:
</p>
<div class="example">
<script type="text/javascript">
$(document).ready(function() {
$('#example-selectAllNumber').multiselect({
includeSelectAllOption: true,
selectAllNumber: false
});
});
</script>
<select id="example-selectAllNumber" multiple="multiple">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
<option value="6">Option 6</option>
</select>
</div>
<div class="highlight">
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
$('#example-selectAllNumber').multiselect({
includeSelectAllOption: true,
selectAllNumber: false
});
});
&lt;/script&gt;
</pre> </pre>
</div> </div>
</td> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment