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
  • !1551

Supporting complex source objects and and adding a handler for on item select

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/tobz/master into master Feb 01, 2012
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: tobz

I was implementing typeahead for searching through a set of objects which had an internal name and a display name... it seems to make sense using $.data() for storing the original item returned in the results so complex objects can be used and not just plain jane strings. I also added a way to specify a handler for when an item is selected. In my case, I just wanted to redirect to another page based on the result, and I had no intention of making a user submit the value.

I'm not sure on the performance implication of using $.data(), but the search is still very zippy even when searching through ~800 objects so I can't imagine it's too terrible.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/tobz/master