I've got the solution to your problem, it's case sensitivity. You'll see that you happen to be referencing Fname
and not FName
. In practise it's best to dispose of any irregular capitalisation like this, just makes maintaining code easier. In terms of filtering for both agentId and names, this is slightly more difficult but I think you'll find the solution here suitable.
I would pass the whole user record around though that would require you to define sorting and all sorts that is already there for you if it's normal alphanumerical items. Gonna try and get it working by passing along to prototype, if I do I'll update.
Looked into passing the sorting calls back to the typeahead library but the overhead just isn't worth it. Hope the above is enough!