Giter VIP home page Giter VIP logo

polymer-select-with-options's Introduction

##Select with options

Replacement for select element that works with browsers (like Internet Explorer, including IE11) that don't support templates (including dom-repeat) inside <select> tags. See Polymer issue #1735.

Quick start

Several quick start options are available:

  • Download the latest release.
  • Clone the repo: git clone https://github.com/vehikl/polymer-select-with-options.git.
  • Install with Bower: bower install polymer-select-with-options.

What's included

For an existing Polymer project, only the select-with-option.html file is required to be imported. The remaining files are for use in the demo.

├── README.md
├── bower.json
├── demo.html
├── polymer-micro.html
├── polymer-mini.html
├── polymer.html
└── select-with-options.html

Usage

Import select-with-options.html into your project;

<link rel="import" href="select-with-options.html">

This component supports data-binding an array of String, an array of Objects as well as hard coded options.

###Array of Strings

Simply bind an array of strings to the 'options-list' attribute. The array values will be mapped to both 'value' and 'label'.

<select is="select-with-options" options-list="{{options}}" value="{{value::change}}"></select>

###Array of Objects

If you supply an array of objects there are additional parameters to specify which object properties to map as the value and label (option-value and option-label).

<select is="select-with-options" options-list="{{options}}" option-value="id" option-label="name" value="{{value::change}}"></select>

###Hard coded options

Just like a standard select element, you can provide hard-coded <option> tags, which are displayed before those provided in the options attribute.

<select is="select-with-options" options-list="{{options}}" option-value="id" option-label="name" value="{{value::change}}">
    <option value="hardcoded_option">Hardcoded Option</option>
</select>

Demo

Live preview available here. Source for demo is available in demo.html

polymer-select-with-options's People

Contributors

dmamills avatar eugef avatar krisbraun avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.