[GH #1227] What is "query" used for in Dropdown source function?

Tags: #<Tag:0x00007efc6b95c770> #<Tag:0x00007efc6b95c590>

Is there an explanation of what the “query” parameter used for in your “Autocomplete strict mode (Ajax)” example at the link below is used for? How or why would I use this?

Code snippet:

  columns: [
    {
      type: 'autocomplete',
      
     // how and why is the below 'query' parameter used?
      source(query, process) {
        fetch('https://handsontable.com/docs/scripts/json/autocomplete.json')
          .then(response => response.json())
          .then(response => process(response.data));
      },
      strict: true
    },

Link:

Autocomplete cell type - JavaScript Data Grid | Handsontable

Hi @ptownbro

Thank you for reporting this. Indeed, there is no explanation of what those parameters are, and how they should be used. Also, I couldn’t find any information about it in the source code. I have reported this internally, and I’ll update you as soon as we fix this.

Great. Thank you! Look forward to a future reply. In the meantime… on to the next one. :slight_smile:

query is the search query or the search term. You can use this query variable and pass it to the fetch if you have a search endpoint.

Hi @r.evangelio

Thank you for this information. Nevertheless, we will fix the description in the documentation to avoid any confusion.