What would be the trick for the right value bindings setup for having in the select input dropdown field only the timezones relevant to the country selected in a previous select input field?
In the data source, you need to use a where filter with the binding.
Once a country is selected, it will automatically filter the data and show just the limited timezones in select component.
If the filtered list of where clause returns you a comma separated list ALWAYS, you can do something like:
countryRestApi.data.where('name', country.value, '==')[0].utctimes.split(',')
OR
countryRestApi.data.where('name', country.value, '==').values('utctimes')[0].split(',')
But, if that is not the case, you will have to create a custom formatter in JS which will read each of the rows in filtered data, and create a new array of items from that. Resulting in a merge single list of all filtered rows & their multiple comma separated value.
Thanks.
Not always comma separated alas since arrays can have one value.
{“name”:“India”,“timezones”:[“UTC+05:30”]}, {“name”:“USA”,“timezones”:[“UTC-12:00”,“UTC-11:00”,“UTC-10:00”,“UTC-09:00”,“UTC-08:00”,…"]}
I’ll explore the forEach function in JS but how do I create a custom formatter and use it?