Hi everyone
I want to disable a option in Dropdown Search.
I have read Virtual Select but I don't know how to use it.
So please give me somw way to di this.
Thanks !!
Hi Cao,
To address your requirement, you will need to use the setDisabledOptions() method. Please follow the implementation steps outlined below:
Implementation Steps:
JS Snippet:
OutSystems.OSUI.Patterns.DropdownAPI.GetDropdownById($parameters.DropdownSearchId).virtualselectConfigs.setDisabledOptions(JSON.parse($parameters.DisabledOptions));
Demo link: DropdownSearchOptionDisableTask
Document Link: virtual-select | setdisabledoptions
Refer to the attached oml. I hope this helps you!
Kind regards,
Benjith Sam
Thanks for you solution!
But I am using OutsystemsUI version 2.12.0 so when run in brower it throw exception that setDisabledOptions can't read.
Do you have any solution for this case
Sorry for my late response. You'll need to make a minor adjustment (as highlighted below) to adapt the provided solution to function with OS UI version 2.12.0.
Add an underscore ('_') as a prefix to virtualselectConfigs.
OutSystems.OSUI.Patterns.DropdownAPI.GetDropdownById($parameters.DropdownSearchId)._virtualselectConfigs.setDisabledOptions(JSON.parse($parameters.DisabledOptionValues));
Note: Ensure that you provide the setDisabledOptions method with an array containing the disabled dropdownSearch option values.
I hope this helps you!
I hope you're doing well.
If I understood your question you want to disable an option in the list that populates the Dropdown Search, right?
If yes, in the OnAfterFetch action of the Data Fetch that populates your Dropdown Search:
Let me know if this solves your issue.
Cheers,
FC
Hi Fábio Miguel Ferreira Coelho
I want show it in the list but can click and select this option
Do you want the option in the list but will be not possible to select?
Regards, Paulo Torres
Hi Paulo Torres
Yes that is what i want to do
Hello Cao,
Please refer below component and a related post, this might help you achieve what you want
https://www.outsystems.com/forge/component-overview/13122/enable-disable-dropdown-optiongrad-out-in
https://www.outsystems.com/forums/discussion/82109/set-some-options-not-selectable-in-dropdown/
Thanks,
Junaid