Skip to content
This repository was archived by the owner on Dec 16, 2019. It is now read-only.

Commit d938709

Browse files
committed
Added ability to access search filter from outside
1 parent 4823b33 commit d938709

File tree

5 files changed

+77
-4
lines changed

5 files changed

+77
-4
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-dropdown-multiselect",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"authors": [
55
"Dotan Simha <[email protected]>"
66
],

dist/angularjs-dropdown-multiselect.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pages/javascripts/pages/home/ExampleCtrl.js

+14
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,18 @@ angular.module('exampleApp').controller('ExampleCtrl', ['$scope', function($scop
141141
scrollableHeight: '100px',
142142
scrollable: true
143143
};
144+
145+
$scope.example15model = [];
146+
$scope.example15data = [
147+
{id: 1, label: "David"},
148+
{id: 2, label: "Jhon"},
149+
{id: 3, label: "Lisa"},
150+
{id: 4, label: "Nicole"},
151+
{id: 5, label: "Danny"}];
152+
153+
$scope.example15settings = {
154+
enableSearch: true
155+
};
156+
157+
$scope.customFilter = 'a';
144158
}]);

pages/javascripts/pages/home/home.html

+58
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,58 @@ <h3>Code</h3>
536536
</div>
537537
</div>
538538
</accordion-group>
539+
<accordion-group heading="External Search Filter">
540+
<div class="row">
541+
<div class="col-xs-12">
542+
This example shows a demostration of access and set the search filter from outside the directive.
543+
<br />This can be done by settings the "search-filter" attribute.
544+
<br />
545+
</div>
546+
</div>
547+
<div class="row">
548+
<div class="col-xs-12 col-sm-6">
549+
<h3>Demo</h3>
550+
<div class="well">
551+
<div>
552+
<div ng-dropdown-multiselect search-filter="customFilter" options="example15data" selected-model="example15model" extra-settings="example15settings"></div>
553+
</div>
554+
</div>
555+
</div>
556+
<div class="col-xs-12 col-sm-6">
557+
<h3>The model:</h3>
558+
<pre>{{example7model|json}}</pre>
559+
<h3>Search Filter:</h3>
560+
<pre>{{customFilter|json}}</pre>
561+
</div>
562+
</div>
563+
<div class="row">
564+
<div class="col-md-12">
565+
<h3>Code</h3>
566+
<div class="well">
567+
<div>
568+
<div hljs>
569+
// HTML
570+
<div ng-dropdown-multiselect search-filter="customFilter" options="example15data" selected-model="example15model" extra-settings="example15settings"></div>
571+
572+
// JavaScript
573+
574+
$scope.example15model = [];
575+
$scope.example15data = [
576+
{id: 1, label: "David"},
577+
{id: 2, label: "Jhon"},
578+
{id: 3, label: "Lisa"},
579+
{id: 4, label: "Nicole"},
580+
{id: 5, label: "Danny"}];
581+
582+
$scope.example15settings = {enableSearch: true};
583+
584+
$scope.customFilter = 'a';
585+
</div>
586+
</div>
587+
</div>
588+
</div>
589+
</div>
590+
</accordion-group>
539591
<accordion-group heading="Checkboxes List">
540592
<div class="row">
541593
<div class="col-xs-12">
@@ -626,6 +678,12 @@ <h2>Attributes</h2>
626678
<td>Boolean</td>
627679
<td>Indicated if to show a normal dropdown with glyphicons or HTML checkboxes.</td>
628680
</tr>
681+
<tr>
682+
<td><strong>search-filter</strong>
683+
</td>
684+
<td>String</td>
685+
<td>Uses for settings the search filter from outside the direcrtive.</td>
686+
</tr>
629687
</tbody>
630688
</table>
631689
<h2>Settings</h2>

0 commit comments

Comments
 (0)