ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

autocomplete search option not working when using external source #85

Open duckduckhero opened 4 years ago

duckduckhero commented 4 years ago

while($row = mysqli_fetch_array($result)){ $user = array('value'=>$row['name'], 'uid'=>'user:'.$row['u_id']); array_push($user_data, $user); } $output = json_encode($user_data); echo $output;

I used the above get_users.php code to return the list of users in a JSON form. Then, I used the following JS code to implement mention feature in my html webpage.

$('.mentions').mentionsInput({ source: 'get_users.php', showAtCaret: true });

It seemed to work fine at first, but soon I realized that the autocomplete search(?) function was not working. That is, when I type in "Jeff" for example, the list will not show me the corresponding "Jeff Lee", but it will just stay the same and not change. Can anyone please tell me how I can fix this? Thank You.