#Is it possible to make a dropdown from material UI dynamic?

55 messages · Page 1 of 1 (latest)

autumn vault
#

Is it possible to make a dropdown from material UI dynamic and get the list inside in dropdown from a database?

slow maple
autumn vault
#

can i get a list from a database and display it in my dropdown?

slow maple
#

Yes, but first you need to get the data from your database to Angular (Angular is a frontend framework)

autumn vault
#

yes i know, what part of the examples i should use?

#

i was asking if its possible because while using material ui i cannot a good examples how to display the data to my dropdown

slow maple
#

I created this example for you I hope it helps

#

So I got the data from the server side as JSON file I parse it into an array and I displayed the array on Select dropdown

slow maple
#

@autumn vault

autumn vault
#

oh that's nice, can we have it like filter as I type a name? like if I typed assunta only assunta will show in the dropdown

#

I am new this so i need a bit help

#

but it maked sense now

#

@slow maple

slow maple
autumn vault
#

what i need can be done with the example you made right?

#

do i just replace the dropdown with that right?

#

can you do it in that stackblitz app?

slow maple
#

I think you would be able to do it yourself. Just try to play with it and search.

autumn vault
#

oh okay thankyou!

autumn vault
#

hello @slow maple i had some errors while making this

#

i really need this today

#

can you please help me

#

i tried to make it on my local machine

#

but no luck 😦

#

i just can't understand how to inject the data from the server to my autocomplete dropdown search 😦

#

pleasee bro 😦

slow maple
#

what are the errors?

autumn vault
#

They can't bit to the input and mat autocomplete does't show up instead it show's error

#

what i did it

#

is

#

i copy the autocomplete and copied the ngfor statement and the values

slow maple
#

please show the error.

autumn vault
#

and the user.firstname to userlast name

#

sure ill replicate it on stackblitz

#

there its on stackblitz

#

its on the one you sent

#

i need to also have a dropdown search thing just like you example but i can type

#

@slow maple

#

let me check it might be the imports but you can chech

#

check

#

naw

#

it doest work

#

@slow maple

#

@slow maple i dont know how to add the input it has an error on the formcontrol and matautocomplete

#

Hello @slow maple any updates? 😦

slow maple
#

Hello

#

you are not using it as the documentation suggested

#

Please look at the example in the documentation for this controller and how to use it

#

also make sure you make the proper imports

autumn vault
#

can you guide me

#

Ill close this now

#

ill post another one maybe i can get a better understanding of things and how it works