sergiodlopes / jquery-flexdatalist

Flexible input autocomplete/datalist plugin for jQuery
http://projects.sergiodinislopes.pt/flexdatalist/
MIT License
365 stars 84 forks source link

How to prepend custom string in front of search list items? #216

Open vincenthawke opened 5 years ago

vincenthawke commented 5 years ago

It works well for items once they are selected. HTML:

data-text-property='{name}, Custom string: {someProperty}'

But I can't get it to appear for all intermediary results on the drop-down list. There it would only say: name, someProperty

Editing JS: textProperty: '{name}, {someProperty} before someProperty did nothing. I am required to add some explanatory labels in front of searchable items but would prefer not to edit the JSON file with duplicating label data for every item.

Edit: It seems that one can either use HTML data-text-property OR JavaScript textProperty to do the same thing and only need one of them.