#185: Typeahead for usernames on 'assign to' fields
--------------------------+---------------------
Reporter: jdreimann | Owner: nobody
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: ui design | Version:
Resolution: | Keywords: starter
--------------------------+---------------------
Comment (by mudri):
I've been looking into this issue, using AutocompleteUsersPlugin. One
problem is that, on version 0.6, inputs are destroyed and recreated at
various times. In this process, they lose the event bindings they are
supposed to get from the plugin. Fixing this seems to be messy.
When modifying a ticket (from a /ticket/1234 page), the inputs are
recreated when the “Modify Ticket” button is clicked. This can be
accounted for by calling `$('#inplace-edit-button').click()` with the
plugin's `$(document).ready()` handler. Note that `$('#inplace-edit-
button')` is the parent of the actual button. Binding to the button causes
the plugin's event handlers to be bound to the to-be-replaced inputs.
New tickets (on /newticket, still using the bh_ticket.html template) are
more difficult. The inputs are recreated in the `$(document).ready()`
handler, and there is no later event to bind to. The best solution I can
find involves triggering a custom event at the end of the template's
`$(document).ready()` handler, and then having the plugin listen for that.
However, it would probably be better to not have the inputs regenerating
at all. The creation is done through cloning dummy elements, which are the
elements that get the event handlers through all the `$(document).ready()`
calls. The new inputs are duplicates without the event handlers, and
worryingly have the same `id`s.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/185#comment:6>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker