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

Commit

Permalink
Added ability to access search filter from outside
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Sep 2, 2014
1 parent 4823b33 commit d938709
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularjs-dropdown-multiselect",
"version": "1.5.1",
"version": "1.5.2",
"authors": [
"Dotan Simha <dotansimha@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/angularjs-dropdown-multiselect.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions pages/javascripts/pages/home/ExampleCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,18 @@ angular.module('exampleApp').controller('ExampleCtrl', ['$scope', function($scop
scrollableHeight: '100px',
scrollable: true
};

$scope.example15model = [];
$scope.example15data = [
{id: 1, label: "David"},
{id: 2, label: "Jhon"},
{id: 3, label: "Lisa"},
{id: 4, label: "Nicole"},
{id: 5, label: "Danny"}];

$scope.example15settings = {
enableSearch: true
};

$scope.customFilter = 'a';
}]);
58 changes: 58 additions & 0 deletions pages/javascripts/pages/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,58 @@ <h3>Code</h3>
</div>
</div>
</accordion-group>
<accordion-group heading="External Search Filter">
<div class="row">
<div class="col-xs-12">
This example shows a demostration of access and set the search filter from outside the directive.
<br />This can be done by settings the "search-filter" attribute.
<br />
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6">
<h3>Demo</h3>
<div class="well">
<div>
<div ng-dropdown-multiselect search-filter="customFilter" options="example15data" selected-model="example15model" extra-settings="example15settings"></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<h3>The model:</h3>
<pre>{{example7model|json}}</pre>
<h3>Search Filter:</h3>
<pre>{{customFilter|json}}</pre>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>Code</h3>
<div class="well">
<div>
<div hljs>
// HTML
<div ng-dropdown-multiselect search-filter="customFilter" options="example15data" selected-model="example15model" extra-settings="example15settings"></div>

// JavaScript

$scope.example15model = [];
$scope.example15data = [
{id: 1, label: "David"},
{id: 2, label: "Jhon"},
{id: 3, label: "Lisa"},
{id: 4, label: "Nicole"},
{id: 5, label: "Danny"}];

$scope.example15settings = {enableSearch: true};

$scope.customFilter = 'a';
</div>
</div>
</div>
</div>
</div>
</accordion-group>
<accordion-group heading="Checkboxes List">
<div class="row">
<div class="col-xs-12">
Expand Down Expand Up @@ -626,6 +678,12 @@ <h2>Attributes</h2>
<td>Boolean</td>
<td>Indicated if to show a normal dropdown with glyphicons or HTML checkboxes.</td>
</tr>
<tr>
<td><strong>search-filter</strong>
</td>
<td>String</td>
<td>Uses for settings the search filter from outside the direcrtive.</td>
</tr>
</tbody>
</table>
<h2>Settings</h2>
Expand Down

0 comments on commit d938709

Please sign in to comment.