I just start with Dojo and my problem is the follow:
I have a FilteringSelect, where my search uses the idea of a like %john%.
So my filter will select and value with “john” in the list, so after write john I can have a list as:
Andrew John
John
John Alen
Simon John
So the “like” idea works fine.
The problem is: when I write “john” and press enter. The selected name is always the first in the list for instance “Andrew John” and not the second that is an exact match. Any one has an ideia how to solve this problem?
Thank you
The normal behaivour of the FilteringSelect is always get the first element of the combobox. Because usually this is the exact match. Due the fact that my serach was “like” in the text the first element is not always the exact macth.
So, to solve my problem I changend the FilteringSelect.js, so I do a check to see if in the combobox option there is an exact match and return this element. The my case the exact match can be the second, third… in the combobox list. if there isn’t I return the first one (as was before).
Here the code: