3
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
Code distributed by Google as part of the polymer project is also
8
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
12
<link rel="import" href="../polymer/polymer.html">
13
<link rel="import" href="iron-multi-selectable.html">
17
`iron-selector` is an element which can be used to manage a list of elements
18
that can be selected. Tapping on the item will make the item selected. The `selected` indicates
19
which item is being selected. The default is to use the index of the item.
23
<iron-selector selected="0">
29
If you want to use the attribute value of an element for `selected` instead of the index,
30
set `attrForSelected` to the name of the attribute. For example, if you want to select item by
31
`name`, set `attrForSelected` to `name`.
35
<iron-selector attr-for-selected="name" selected="foo">
36
<div name="foo">Foo</div>
37
<div name="bar">Bar</div>
38
<div name="zot">Zot</div>
41
If no matching element is found using `attForSelected`, use `fallbackSelection` as fallback.
45
<iron-selector attr-for-selected="name" selected="non-existing"
46
fallback-selection="default">
47
<div name="foo">Foo</div>
48
<div name="bar">Bar</div>
49
<div name="default">Default</div>
52
Note: When the selector is multi, the selection will set to `fallbackSelection` iff
53
the number of matching elements is zero.
55
`iron-selector` is not styled. Use the `iron-selected` CSS class to style the selected element.
67
<iron-selector selected="0">
81
Polymer.IronMultiSelectableBehavior