How to add configuration options to devextreme autocomplete component in Angular 2

1.2k views Asked by At

How to add Configuration options to devextreme autocomplete component Presently the code is

<dx-autocomplete [dataSource]='users' 
                 [searchExpr]='["DisplayName","Email"]'   
                 [displayExpr]='["DisplayName","Email"]'}'> 
</dx-autocomplete>

The component shows up but, when I type to search a text, options are populating as [Object Object] and not options text

datasource = [{"DisplayName":"Sa","Email":"sa.gmail.com"}]

And search should be possible by both 'Email' and 'DisplayName'

1

There are 1 answers

1
Dmitry Levkovsky On BEST ANSWER

You can achieve your goal by using item template and valueExpr option. I've prepared a planker that demonstrate this technique.