Commit cfa64abf authored by David Stutz's avatar David Stutz

Merge pull request #442 from Tyf0x/fix_#427

** Fix for #427 **
parents 778c55c0 4aa63626
......@@ -1276,6 +1276,11 @@
return setTimeout(function() {
callback.apply(self || window, args);
}, timeout);
},
setAllSelectedText: function(allSelectedText) {
this.options.allSelectedText = allSelectedText;
this.updateButtonText();
}
};
......
......@@ -2869,6 +2869,48 @@
$('#example-dataprovider-optgroups').multiselect('dataprovider', optgroups);
</script>
<select id="example-dataprovider-optgroups" multiple="multiple"></select>
</pre>
</div>
</td>
</tr>
<tr>
<td>
<code>.multiselect('setAllSelectedText', value)</code>
</td>
<td>
<p>
This method is used to programmatically provide a new text to display in the button when all options are selected, at runtime.
</p>
<div class="example">
<div class="btn-group">
<script type="text/javascript">
$(document).ready(function() {
$('#example-set-all-selected-text').multiselect({allSelectedText: "Initial All Selected"});
$('#new-all-selected-text-btn').click(function(){
$('#example-set-all-selected-text').multiselect('setAllSelectedText', $('#new-all-selected-text-box').val());
});
});
</script>
<select id="example-set-all-selected-text" multiple="multiple">
<option value="1" selected>Option 1</option>
</select>
<input id="new-all-selected-text-box" type="text" class="form-control" placeholder="Enter new text"/>
<input id="new-all-selected-text-btn" type="button" class="btn btn-default" value="Change All Selected Text"/>
</div>
</div>
<div class="highlight">
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$('#example-set-all-selected-text').multiselect({allSelectedText: "Initial All Selected"});
$('#new-all-selected-text-btn').click(function(){
$('#example-set-all-selected-text').multiselect('setAllSelectedText', $('#new-all-selected-text-box').val());
});
&lt;/script&gt;
</pre>
</div>
</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