Make default select option other than the disabled option
how to make a default option other than the disabled option.
5 Replies
Something like this?
Thanks, but how to find the first option that is not disabled inside the options array and make it default.. As the options inside array are randomly disabled. for example:
They are not randomly disabled in your example:
If you can share the actual code you're working with, it would be easier to help
Thanks currently on mobile i will share later, is there any function to get the disabled options only: $component->getOptions() which gets all options, $component->getDisabledOptions() which can get the disabled options only
I don't think there is a method like that but also I don't think you need it... in
disableOptionWhen()
, you basically decide which options should be disabled. Does that make sense? You can write a version of disableOptionWhen()
and default()
that takes this into account.