Template for server-side suggest list on JS text?

When populating a combo with a object array, I can use the ‘template’ of the options list directly to use the value from the object. From the documentation for ‘suggest’, it seems I should be able to do the same thing, however I can’t get it to work. Is there a way to use ‘template’ to extract a single object property to use for suggestions? Here’s a snippet of what I thought would work-- the first is a combo with a working options list, the second is a text component an non-working suggestions.

http://webix.com/snippet/9141047f

Thanks!

Hi Maria,

I’m trying to use the ‘filter’ method, since my data is really coming from server-side. When I use your example you provided here:
http://webix.com/snippet/74ae6da9

If I type into the text input “thing” and then select “thing2” from the drop-down select list, it replaces the value of “undefined” into the text input box. If I add a “value” attribute to my data that I use in the suggest list, it works, but I’m not sure how to add it in.

Any recommendations on how to fix?

Thanks!

I have send you link to the fixed build by PM

Hello,

Probably, you meant “richselect” ( not “combo”) when you wrote about “template”. However, if we are talking about suggestions, you need to either use “value” property in data source or change “filter” method for your suggest:

  • you can add value property via scheme $init:

http://webix.com/snippet/059eb38e

  • or change “filter” method:

http://webix.com/snippet/74ae6da9

Hi Maria-- those both work great. Thanks!