Giter Club home page Giter Club logo

Comments (2)

Robdel12 avatar Robdel12 commented on July 28, 2024

Icons can't be displayed in normal <selects>. If you absolutely need to show icons you'll need to use something like DropKick.js or Select2. (Shameless plug, ember-dropkick is an extension of x-select)

In your example code I don't see where optgroups are being added. x-select is a thin ember wrapper around a native select, so native HTML elements should work. Try wrapping an <optgroup> tag around the {{#each}}.

Hope this helps!

from emberx-select.

kgish avatar kgish commented on July 28, 2024

You're right, although it'd be a nice addition anyway if it's not too much work.

Decided to go with the following recipe instead:

<div class="form-group">
  <label class="control-label col-sm-2" for="select-icon">Icon:</label>
  <div class="col-sm-2">
    <div class="btn-group">
      <button type="button" class="btn btn-default">
        <i class="fa fa-{{currentIcon}}"></i>&nbsp; {{currentIcon}}
      </button>
      <button type="button" class="btn btn-default dropdown-toggle" \
        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <span class="caret"></span>
        <span class="sr-only">Toggle Dropdown</span>
      </button>
      <ul class="dropdown-menu">
        {{#each icons as |optgroup|}}
          <li class="disabled">
            <a href="#"><strong> - {{optgroup.group}} - </strong></a>
          </li>
          {{#each optgroup.icons as |icon|}}
            <li>
              <a href="#" {{action 'selectIcon' icon}}>
                <i class="fa fa-{{icon}}"></i>&nbsp; {{icon}}
              </a>
            </li>
          {{/each}}
        {{/each}}
      </ul>
    </div>
  </div>
</div>

from emberx-select.

Related Issues (20)

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.