Topic: Select
Paulo Henrique Capuzzo pro asked 2 years ago
I'm using select which, select is not getting data from fetch, ajax or axios. I used this code. Sometimes it gets the data.
const singleSelect = document.querySelector('#singleSelection');
const singleSelectInstance = mdb.Select.getInstance(singleSelect);
singleSelectInstance.setValue('4');
What do I do?
Thank you so much,
Paulo
Grzegorz Bujański staff answered 2 years ago
How do you get data? Can you create a working snippet in which the issue you are writing about will be visible?
Select itself does not provide a method for retrieving data from the API. You yourself need to handle the data fetching and displaying it on the page,and then initialize select. The code you sent only performs select initialization and sets value, there is no code responsible for getting data from API.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 5.0.0
- Device: Macbook
- Browser: All
- OS: Mac
- Provided sample code: No
- Provided link: No