Commit 877e4590 authored by davidstutz's avatar davidstutz

Support filter with clickable opt groups.

parent 0da8ba8e
......@@ -585,10 +585,11 @@
// Search all option in optgroup
var $options = group.nextUntil('li.multiselect-group');
var $visibleOptions = $options.filter(":visible");
// check or uncheck items
var allChecked = true;
var optionInputs = $options.find('input');
var optionInputs = $visibleOptions.find('input');
optionInputs.each(function() {
allChecked = allChecked && $(this).prop('checked');
});
......
......@@ -1711,6 +1711,44 @@
});
});
</script>
</pre>
</div>
<p>
Clickable <code>optgroup</code>'s are also supported:
</p>
<div class="example">
<script type="text/javascript">
$(document).ready(function() {
$('#example-enableFiltering-enableClickableOptGroups').multiselect({
enableFiltering: true,
enableClickableOptGroups: true
});
});
</script>
<select id="example-enableFiltering-enableClickableOptGroups" multiple="multiple">
<optgroup label="Group 1">
<option value="1-1">Option 1.1</option>
<option value="1-2" selected="selected">Option 1.2</option>
<option value="1-3" selected="selected">Option 1.3</option>
</optgroup>
<optgroup label="Group 2">
<option value="2-1">Option 2.1</option>
<option value="2-2">Option 2.2</option>
<option value="2-3">Option 2.3</option>
</optgroup>
</select>
</div>
<div class="highlight">
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
$('#example-example-enableFiltering-enableClickableOptgroups').multiselect({
enableFiltering: true,
enableClickableOptGroups: true
});
});
&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