0

I have a multiple datasets auto-complete implemented using the Bloodhound with default suggestions and second with a remote source.

minLength is set to '0' and so it works for default suggestions on focus, perfectly.

But the request to the remote is also executed on focus and so alongwith the default, second dataset result is also displayed.

How to make sure that the remote dataset is displayed only when the minLength is more than 0. i.e. 1 or more.

Kunal Dethe
  • 1,254
  • 1
  • 18
  • 38
  • Are you saying you have default value that you always want to display? Have you tried using prefetch? – trenthaynes May 19 '16 at 22:28
  • The default values should be displayed only when there is nothing typed in the textbox and the remote values to be displayed when something is typed. But currently on focus itself, both default and remote values are displayed, so I just need to prevent the remote thing. – Kunal Dethe May 20 '16 at 08:47
  • You can seed default values that display once the control is initialized. Those default values will not go unless the value that is typed excludes them (once you add default values they are included in the search). – trenthaynes May 20 '16 at 13:01
  • Its happening well for defaults like you said but remote request is also sent when nothing is entered in the textbox and so its result is displayed which I want to prevent. One way is that I do not sent back anything in remote if nothing is entered. – Kunal Dethe May 20 '16 at 15:01

0 Answers0