Twitter Bootstrap Typeahead - Id & Label

前端 未结 10 2162
情书的邮戳
情书的邮戳 2020-12-12 13:06

I\'m using Bootstrap 2.1.1 and jQuery 1.8.1 and trying to use Typeahead\'s functionality.

I try to display a label and use an id li

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 13:53

    The selected answer is a bit of a hack. I was looking for the same thing, and this approach works beautifully:

    https://github.com/twbs/bootstrap/pull/3682

    It keeps two arrays, one for the name that typeahead shows, and one for the object from which the name is extracted. When one of the options is selected, it uses the name to find the object from whence it came.

提交回复
热议问题