Giter Club home page Giter Club logo

Comments (4)

ivaynberg avatar ivaynberg commented on May 27, 2024

the usecase for select2 is to "select" something and work with that selection.

i think what you are looking for is more of a type-ahead kind of functionality which i believe is better covered by existing plugins.

for example, bootstrap provides an implementation of such a field here: http://twitter.github.com/bootstrap/javascript.html#typeahead

from select2.

brianmhunt avatar brianmhunt commented on May 27, 2024

Thanks for the response, ivaynberg. The use case I am looking for is to search for and select one item, essentially functionally identical to the AJAX example I linked to (albeit with a different dataset). Sorry for not being clear in my post.

On reflection the issue may simply be aesthetics i.e. can the select2 box be changed to appear aesthetically compatible with the Bootstrap navigation bar, like the Bootstrap navigation search box?

The reason I suggested giving an input tag the select2 functionality is because the styling is already done for input tags. However, there is no reason one couldn't change the select2 select style to match Bootstrap's navigation search box (and that is probably easier and logically it makes more sensible than changing select2's core functionality).

Thanks for the feedback, and I'd love to hear any thoughts you have on styling.

EDIT: Incidentally, Example 11 of the latest version for multiple input basically reflects what I would like to have (in terms of input style being an <input> tag). This doesn't seem to be in version 1.0, and multiple selects isn't what I'm looking for, but that's basically the idea. :)

from select2.

ivaynberg avatar ivaynberg commented on May 27, 2024

you can give it an input tag, but that will put it into multiselect mode. if you are truly selecting then cant you simply use a multiselect, override change event and clear the box after a selection is done + redirect or handle the choice somehow?

from select2.

brianmhunt avatar brianmhunt commented on May 27, 2024

Thanks - that's helpful. As this is essentially styling and beyond the scope, I'll close it. Feel free to re-open if you think Bootstrap-styling comes into the scope of select2's awesomeness. :)

from select2.

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.