Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !1751

Allow Typeahead to accept array of objects

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/cgunther/typeahead-objects into 2.0.1-wip Feb 05, 2012
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 5

Created by: cgunther

I've modified the plugin to accept either an array of strings (current implementation) or an array of objects that have label and value properties, like so:

[
  { label: 'California', value: 'CA' },
  { label: 'New York', value: 'NY' }
]

I also added a selected event that fires when the user selects an item from the results and passes the item that was selected.

This is a big change, but in my testing, should be fully backwards compatible with 2.0.0.

This is similar to, and may suffice for, #1593 (closed), #1518 (closed), and #1551.

It's also fully documented. I'd add to the test suite, but I've never dabbled in QUnit, so I'll have to brush up on that first.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/cgunther/typeahead-objects