| OLD | NEW |
| (Empty) |
| 1 | |
| 2 <!--- | |
| 3 | |
| 4 This README is automatically generated from the comments in these files: | |
| 5 iron-multi-selectable.html iron-selectable.html iron-selector.html | |
| 6 | |
| 7 Edit those files, and our readme bot will duplicate them over here! | |
| 8 Edit this file, and the bot will squash your changes :) | |
| 9 | |
| 10 The bot does some handling of markdown. Please file a bug if it does the wrong | |
| 11 thing! https://github.com/PolymerLabs/tedium/issues | |
| 12 | |
| 13 --> | |
| 14 | |
| 15 [](https://travis-ci.org/PolymerElements/iron-selector) | |
| 16 | |
| 17 _[Demo and API docs](https://elements.polymer-project.org/elements/iron-selector
)_ | |
| 18 | |
| 19 | |
| 20 ##<iron-selector> | |
| 21 | |
| 22 `iron-selector` is an element which can be used to manage a list of elements | |
| 23 that can be selected. Tapping on the item will make the item selected. The `
selected` indicates | |
| 24 which item is being selected. The default is to use the index of the item. | |
| 25 | |
| 26 Example: | |
| 27 | |
| 28 ```html | |
| 29 <iron-selector selected="0"> | |
| 30 <div>Item 1</div> | |
| 31 <div>Item 2</div> | |
| 32 <div>Item 3</div> | |
| 33 </iron-selector> | |
| 34 ``` | |
| 35 | |
| 36 If you want to use the attribute value of an element for `selected` instead of
the index, | |
| 37 set `attrForSelected` to the name of the attribute. For example, if you want
to select item by | |
| 38 `name`, set `attrForSelected` to `name`. | |
| 39 | |
| 40 Example: | |
| 41 | |
| 42 ```html | |
| 43 <iron-selector attr-for-selected="name" selected="foo"> | |
| 44 <div name="foo">Foo</div> | |
| 45 <div name="bar">Bar</div> | |
| 46 <div name="zot">Zot</div> | |
| 47 </iron-selector> | |
| 48 ``` | |
| 49 | |
| 50 `iron-selector` is not styled. Use the `iron-selected` CSS class to style the
selected element. | |
| 51 | |
| 52 Example: | |
| 53 | |
| 54 ```html | |
| 55 <style> | |
| 56 .iron-selected { | |
| 57 background: #eee; | |
| 58 } | |
| 59 </style> | |
| 60 | |
| 61 ... | |
| 62 | |
| 63 <iron-selector selected="0"> | |
| 64 <div>Item 1</div> | |
| 65 <div>Item 2</div> | |
| 66 <div>Item 3</div> | |
| 67 </iron-selector> | |
| 68 ``` | |
| 69 | |
| 70 | |
| 71 | |
| 72 <!-- No docs for Polymer.IronMultiSelectableBehavior found. --> | |
| 73 | |
| 74 <!-- No docs for Polymer.IronSelectableBehavior found. --> | |
| OLD | NEW |