Topic: Autocomplete has not worked (6.1.2)
birmain pro asked 6 years ago
Autocomplete has not worked for me and the same thing happens when I try to reproduce the autocomplete example. (Example for Angular)
No results are produced for the search. When the search string is empty, the result [object Object] is produced
Imports of the necessary components:
In the main module: section imports [MDBBootstrapModulesPro.forRoot()]
In my component: import {CompleterService, CompleterData} from 'ng-uikit-pro-standard';
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Resolved
Specification of the issue
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes
Tags
birmain pro commented 6 years ago
Testing, in the end I have seen the solution: In completerService.local (), there are three parameters, the first is data, the second and third are optionals called searchFields and titleField. The name of the field to look gives the impression that it must go in the second parameter. This does not work. Necessarily you have to put the third with the same content as the second. It seems unclear and poorly documented, but in the end it is solved. . What is the second searchFields parameter for?Damian Gemza staff commented 6 years ago
Dear birmain, Here's the description of three attributes of completerService.local method: 1st: Data - A JSON array with the data to use or an Observable that emits one, 2nd: searchFields - Comma separated list of fields to search on. Fields may contain dots for nested attributes; if empty or null all data will be returned, 3rd: titleField - Name of the field to use a title for the list item. Every one of those fields is required, and autocompleter won't work without any of them. Best Regards, Damian