Autocomplete cell with fuzzy logic results

Tags: #<Tag:0x00007efc61620ef8>

Hi - I am using autocomplete with our API. So the API receives the string typed in and returns results based on that and sometimes as it uses fuzzy logic the results may not have the exact search query in them… The autocomplete cell does its own filtering of the results I pass into it and therefore it filters out my results. I tried attaching the search query to the end of each result string so that handsontable does not filter it out, this worked, but looks bad. So I tried to add HTML so I could just hide the extra text but the HTML gets stripped out…

Do you have a suggestion for what I can do to get around this?

Hi @christine

Sorry for keeping you waiting. I will check what are the options and update you tomorrow.

Hi, @christine. I’m wondering, wouldn’t it be easier for you to use a handsontable cell type if you want to attach HTML inside cells? Here’s an example https://jsfiddle.net/r5of4dsz/1/

If that is not helpful. Please let me know what are you working with. Maybe an example would allow me to offer something more accurate for your use case.

Hi Aleksandra,

It’s less about a need to put HTML into the drop-down and more about getting the autocomplete to work with the returned set of results from my API.

The cell needs to be an autocomplete cell, the value typed in the cell is passed to my API, however said results from the API may not exactly match the original search term due to the API using fuzzy logic to try and return the most useful results… however the HOT autocomplete will further filter down the list provided to it using the value in the cell, which then filters out my fuzzy logic results…

Does that make more sense??

Cheers
Christine

Here https://handsontable.com/docs/8.3.2/demo-autocomplete.html we have an example of loading the source from the server. Please let me know if you have already tried it out.

Yes I already use the autocomplete that way.

The issue is with the further filtering of said results inside handsontable that I have no control over…

Hi @christine,
In that specific case, probably the best option is to extend our build-in AutocompleEditor and overwrite its behaviour with what you need.

You can see an example here: https://jsfiddle.net/swistach/6xhftvk5/.