Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send full name to backend? #46

Open
cmer opened this issue Jul 12, 2012 · 3 comments
Open

Send full name to backend? #46

cmer opened this issue Jul 12, 2012 · 3 comments

Comments

@cmer
Copy link

cmer commented Jul 12, 2012

Is there a way to capture the "full name" of a person and sending it to my backend for search?

For example, if I type "@john Doe", only "John" is sent to the backend when I do a realtime AJAX name search. This has 2 side effects:

  • the full name is not highlighted properly in the dropdown
  • I cannot filter the results accordingly. This is problematic since I have a few thousand users. I want to reduce the size of the dropdown as much as possible.

I made a short screencast to illustrate the problem: http://db.tt/5Sky8XVT

I'm not sure if this is a bug, a mis-configuration or simply something that was not implemented. Thanks!

For the record, this is my onDataRequest code (in Coffeescript):

onDataRequest: (mode, query, callback) ->
  $.getJSON "/#{window.communitySlug}/memberships.json?q=" + encodeURIComponent(query), (responseData) ->
    responseData = _.filter(responseData, (item) ->
      item.name.toLowerCase().indexOf(query.toLowerCase()) > -1
    )
    callback.call this, responseData
@cmer
Copy link
Author

cmer commented Jul 12, 2012

Another example of this issue is that if I start typing the first name, then part of the last name and hit Enter, the part of the last name I typed stays there after the mention.

Again, short screencast here: http://db.tt/vYNsWOdY

@AlainPilon
Copy link

+1

@SteelBRS
Copy link

SteelBRS commented Aug 1, 2012

Hmm, I guess the implementation of this would be to send from the triggerChar to the caret location.
Consider editing this text:
'@john Doe| is a slob'
Checking the caret location is a must, since else it would send until EOL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants