Skip to content

Commit

Permalink
v1.4.0 (#17)
Browse files Browse the repository at this point in the history
* v1.4.0

* v1.4.0

* v1.4.0

* Update README.md
  • Loading branch information
andreww1011 committed Jun 15, 2022
1 parent 66acc6f commit 9a4c7ae
Show file tree
Hide file tree
Showing 16 changed files with 755 additions and 331 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# filter-multi-select
<p>Multiple select dropdown with filter jQuery plugin.</p>

<p><a href="https://jsfiddle.net/andreww1011/c4gr5wqa/">JSFiddle</a></p>
<p><a href="https://jsfiddle.net/andreww1011/s5rp8buv/">JSFiddle</a></p>

<p>Improve the useability of HTML <code>&ltselect&gt</code> elements:
<ul>
Expand Down Expand Up @@ -66,6 +66,7 @@
<li><code>filterText</code> - text to show in filter when empty. <i>default="Filter"</i></li>
<li><code>selectAllText</code> - label for the select all dropdown item. <i>default="Select All"</i></li>
<li><code>labelText</code> - label to display in the main dropdown. <i>default=""</i></li>
<li><code>selectionLimit</code> - limit the number of items able to be selected. Choosing <small><code>1</code></small> or omitting the <small><code>multiple</code></small> attribute turns this into a single select. A value of <small><code>0</code></small> means no limit. <i>default="0"</i></li>
<li><code>caseSensitive</code> - whether filtering is case-sensitive. <i>default=false</i></li>
<li><code>allowEnablingAndDisabling</code> - whether programmatically toggling disabled is permitted. <i>default=true</i></li>
<li><code>items</code> - array of additional items to append to options in dropdown. Each array entry should have the form: <br />
Expand Down
297 changes: 196 additions & 101 deletions dist/FilterMultiSelect.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/FilterMultiSelect.js.map

Large diffs are not rendered by default.

39 changes: 38 additions & 1 deletion dist/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h4 class="col-12">Default Dropdown</h4>
<h4 class="col-12">Dropdown with pre-sets and case-sensitive filtering</h4>
</div>
<div class="form-group row">
<!-- <label class="col-2 col-form-label" for="shapes">Shapes</label> -->
<label class="col-2 col-form-label" for="shapes"></label>
<div class="col-10">
<select multiple name="shapes" id="shapes">
<option value="1" selected>Square</option>
Expand Down Expand Up @@ -195,6 +195,39 @@ <h4 class="col-12">Dropdown with items added via js</h4>
</select>
</div>
</div>
<div class="row">
<h4 class="col-12">Single Select</h4>
</div>
<div class="form-group row">
<label class="col-2 col-form-label" for="colors">Colors</label>
<div class="col-10">
<select name="colors" id="colors">
<option value="1">Red</option>
<option value="2">Orange</option>
<option value="3">Yellow</option>
<option value="4" disabled>Green</option>
<option value="5">Blue</option>
<option value="6">Indigo</option>
<option value="7">Violet</option>
</select>
</div>
</div>
<div class="row">
<h4 class="col-12">Limit Selection Count</h4>
</div>
<div class="form-group row">
<label class="col-2 col-form-label" for="trees">Trees</label>
<div class="col-10">
<select multiple name="trees" id="trees">
<option value="1">Oak</option>
<option value="2" selected disabled>Pine</option>
<option value="3" selected >Maple</option>
<option value="4" disabled>Poplar</option>
<option value="5">Beech</option>
<option value="6">Magnolia</option>
</select>
</div>
</div>
<button type="submit">Submit Form</button>
</form>
<div class="container">
Expand Down Expand Up @@ -273,6 +306,10 @@ <h4 class="col-12">Dropdown with items added via js</h4>
["Berlin","d",true,true],
],
});
var colors = $('#colors').filterMultiSelect();
var trees = $('#trees').filterMultiSelect({
selectionLimit: 3,
});
$('#jsonbtn1').click((e) => {
var b = true;
$('#jsonresult1').text(JSON.stringify(getJson(b),null," "));
Expand Down

0 comments on commit 9a4c7ae

Please sign in to comment.