Building an key => value autocomplete

Tags: #<Tag:0x00007efc6de95500>

Hi, i’m building an key => value autocomplete for my project but I have a problem.

The normal autocomplete with values only: http://jsfiddle.net/tvcaj7zr/
My autocomplete with keys stored and values displayed: http://jsfiddle.net/86kdhs5s/1/

It works pretty well, when you type a value, the key of the value is saved in the cell for the server side but the value is displayed to the user.

The problem I have: source function of my autocomplete is called every time I do a change, on table loading, for all the cells! In contrary of the normal autocomplete behavior, which execute the source function only on double click on a cell and while typing text in the cell.

Can you please help me to solve this issue ? To make my autocomplete behave like the original one.

Thank you in advance !

Hi @even-mind

I do not think if you’d be able to refresh only a single cell before we add the eco-rendering option, but I will check that. Please give me some time to test it.

Hi @aleksandra_budnik,

Thank you. I found that in the renderer, at line 381 the source function is executed to find the value of cell in the source return and store the key. So probably I should check for the key on another way.

  source(value, rowObj,
    function(choices) {
      list = choices;
    }
  );

Oh, I see. I’m glad that you found the cause. Thank you for an update.