summaryrefslogtreecommitdiffstats
path: root/doc/views/demo-helper-elements.htm
diff options
context:
space:
mode:
Diffstat (limited to 'doc/views/demo-helper-elements.htm')
-rw-r--r--doc/views/demo-helper-elements.htm116
1 files changed, 116 insertions, 0 deletions
diff --git a/doc/views/demo-helper-elements.htm b/doc/views/demo-helper-elements.htm
new file mode 100644
index 0000000..c2e96cf
--- /dev/null
+++ b/doc/views/demo-helper-elements.htm
@@ -0,0 +1,116 @@
+<div class="row">
+ <div class="col-sm-12">
+
+ <h3 class="pageHeading">Demo > Helper Elements</h3>
+
+ <p>
+ You can define which helper elements to be displayed by using attribute <code>helper-elements</code>, such as:
+ </p>
+ <div
+ isteven-multi-select
+ input-model="modernBrowsers"
+ output-model="outputBrowsers"
+ button-label="icon name"
+ item-label="icon name maker"
+ tick-property="ticked"
+ helper-elements="all filter"
+ >
+ </div>
+
+ <p>&nbsp;</p>
+ <div role="tabpanel">
+
+ <!-- Nav tabs -->
+ <ul class="nav nav-tabs" role="tablist">
+ <li role="presentation" class="active"><a data-target="#view" aria-controls="home" role="tab" data-toggle="tab">View</a></li>
+ <li role="presentation"><a data-target="#controller" aria-controls="profile" role="tab" data-toggle="tab">Controller</a></li>
+ </ul>
+
+ <!-- Tab panes -->
+ <div class="tab-content">
+ <div role="tabpanel" class="tab-pane active" id="view">
+ <p>Define your directive:</p>
+ <pre><code>&lt;div
+ isteven-multi-select
+ input-model="modernBrowsers"
+ output-model="outputBrowsers"
+ button-label="icon name"
+ item-label="icon name maker"
+ tick-property="ticked"
+ ...
+ helper-elements="all filter"
+&gt;
+&lt;/div&gt;</code></pre>
+ </div>
+ <div role="tabpanel" class="tab-pane" id="controller">
+ <p>Define your input-model:</p>
+ <div class="fauxCode hljs xml">
+ $scope.modernBrowsers = [
+ <table>
+ <tr class="hljs-tag" ng-repeat="row in modernBrowsers" >
+ <td>&nbsp;</td>
+ <td>{</td>
+ <td><span class="hljs-attribute">icon</span>: <span class="hljs-value">"{{removeHost(row.icon)}}"</span>,</td>
+ <td><span class="hljs-attribute">name</span>: <span class="hljs-value">"{{row.name}}"</span>,</td>
+ <td><span class="hljs-attribute">maker</span>: <span class="hljs-value">"{{row.maker}}"</span>,</td>
+ <td><span class="hljs-attribute">ticked</span>: <span class="hljs-value">{{row.ticked}}</span></td>
+ <td>}<span ng-if="$index < modernWebBrowsers.length - 1">,</span></td>
+ </tr>
+ </table>
+ ];
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="col-sm-12">
+ <h5>Output model</h5>
+ <p>
+ Look at the <code>output-model</code> below to see the values getting updated
+ as you select / deselect an item in the directive. Icons in the objects are actually full HTML <code>img</code> tag, shortened for simplicity.
+ </p>
+ <div class="fauxCode hljs xml">
+ $scope.outputBrowsers = [
+ <table>
+ <tr class="hljs-tag" ng-repeat="row in outputBrowsers" >
+ <td>&nbsp;</td>
+ <td>{</td>
+ <td><span class="hljs-attribute">icon</span>: <span class="hljs-value">"{{removeHost(row.icon)}}"</span>,</td>
+ <td><span class="hljs-attribute">name</span>: <span class="hljs-value">"{{row.name}}"</span>,</td>
+ <td><span class="hljs-attribute">maker</span>: <span class="hljs-value">"{{row.maker}}"</span>,</td>
+ <td><span class="hljs-attribute">ticked</span>: <span class="hljs-value">{{row.ticked}}</span></td>
+ <td>}<span ng-if="$index < modernWebBrowsers.length - 1">,</span></td>
+ </tr>
+ </table>
+ ];
+ </div>
+
+ <h5>Other examples</h5>
+ <p>
+ The attribute accepts a combination of "all none filter reset", in space separated string. Example:
+ <ul>
+ <li><code>helper-elements="filter"</code>: will display the search (filter) field only</li>
+ <li><code>helper-elements="all none"</code>: will display the "Select all" and "Select none" buttons</li>
+ <li><code>helper-elements=""</code>: will display no helper elements at all</li>
+ </ul>
+ </p>
+ <br />
+ <p>
+ <span class="label label-primary">Note</span>
+ When the directive is disabled (using <code>is-disabled</code> property), the helper elements will be disabled except the filter field.
+ The purpose is to allow you to search and see the selection state even when the directive is disabled.
+ </p>
+ </div>
+</div>
+
+<script>
+ $(document).ready(function() {
+ $('pre code').each(function(i, block) {
+ hljs.highlightBlock(block);
+ });
+ });
+</script>