How about the purpose of Choices_v3_0_3

Hi all,

When I was studying DropdownSelect, I found it's used in JavaScript,I want to know what it does,thanks

Solution

Hi Yi,

Most of the UI widgets in OutSystems will use Javascript, as that is what the browser's language is.

In many cases, OutSystems uses existing Javascript libraries to implement some functionality.

For the DropDownSelect the https://github.com/jshjohnson/Choices library is used. For detail working of the library, you can visit the link.

The line you show is setting up javascript variable choices as a new Choices() object, for the HTML element identified with widgetId and passing in an options variable which is a JSON structure with options relevant to the Choices object.

Long story short, it initializes the OutSystems widget to behave as a choices object.

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi Yi,

Most of the UI widgets in OutSystems will use Javascript, as that is what the browser's language is.

In many cases, OutSystems uses existing Javascript libraries to implement some functionality.

For the DropDownSelect the https://github.com/jshjohnson/Choices library is used. For detail working of the library, you can visit the link.

The line you show is setting up javascript variable choices as a new Choices() object, for the HTML element identified with widgetId and passing in an options variable which is a JSON structure with options relevant to the Choices object.

Long story short, it initializes the OutSystems widget to behave as a choices object.

Regards,

Daniel


Thanks for your help