Auto complete not working
Hi,
The auto complete is not give me any result when I type something in the input.
I only receive some of the results when i hit the down or up key from the keyboard. I need to use object data and not array how is specified in the example provided here: https://ej2.syncfusion.com/vue/documentation/auto-complete/getting-started/.
Here is my implementation:
<ejs-autocomplete :focus="focus" :blur="blur" name="search" :highlight='highlight' :dataSource='this.$store.state.userModule.users' :fields='fields' :placeholder="waterMark" v-model="selectedUserId"></ejs-autocomplete>
This is the structure that dataSource is receives :
[
{
"id": "475daec4-40b1-4bfe-87ca-4175b245441d",
"firstName": "Wolfgang",
"lastName": "Wolfgang",
"email": "[email protected]",
"unifiedName": "Wolfgang"
},
{
"id": "048d5af0-8caa-4cc7-acc8-06dc52419b40",
"firstName": "Andreas34",
"lastName": "Andreas",
"email": "[email protected]",
"unifiedName": "Andreas"
}
]
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
PM
Ponmani Murugaiyan
Syncfusion Team
June 16, 2021 01:51 PM UTC
Hi Bogdan,
Thanks for contacting Syncfusion support.
By default, the suggestion count in AutoComplete component is 20. So if you type any character the first matched 20 items in the datasource will be shown in the popup. You can increase the count by updating this property as like below code snippet to meet your requirement.
|
<ejs-autocomplete :dataSource="data" :fields="fields" :placeholder="watermark" :suggestionCount="30" popupHeight="450px"></ejs-autocomplete> |
Also, we would like to know you that you can only bind the value field to the AutoComplete as per component intended behaviour. Please refer the below link for more information about Autocomplete component behaviour.
Regards,
Ponmani M
BB
Bogdan Burlica
June 16, 2021 07:10 PM UTC
Hi Ponmani,
The fields input is not working with text and value.
On the :fields input if I remove the "value: id" it's working but I need like this:
fields: { text: 'email', value: 'id' }
PM
Ponmani Murugaiyan
Syncfusion Team
June 17, 2021 02:31 PM UTC
Hi Bogdan,
Thanks for the update.
As per the AutoComplete component intended behaviour, you can bind only the value field to the component . So in order to bind both text and value fields, we suggest you to use the ComboBox component with filtering option, which has the similar features and functionality as like AutoComplete component. For more information, please refer the below demo site and documentation.
Regards,
Ponmani M
Marked as answer
BB
Bogdan Burlica
June 18, 2021 04:47 PM UTC
Thank you,
I have implemented the combobox.
PM
Ponmani Murugaiyan
Syncfusion Team
June 21, 2021 06:03 AM UTC
Hi Bogdan,
Thanks for the update. Please get back us if you need further assistance.
Regards,
Ponmani M
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
- Marked answer
-
BB Bogdan Burlica
- Jun 15, 2021 05:41 PM UTC
- Jun 21, 2021 06:03 AM UTC