Trigger segment "click"

Hi,

I have a segment which contains some “options” , I am looping through the options in init and want to select one of the options to be shown once page has loaded depending on a condition.

Problem to solve: Once I found the option I want to be “pre-clicked” I don’t know how to have this option as “clicked” or selected from start without having to interact my self and click with the mouse.
So right now it’s always the first option that is pre-selected in the list instead of an option according to my conditional in init.

Snippet: https://snippet.webix.com/mzbx0qr8

Hello, @KurtOlsson

To set a value selected by some logic as the chosen one, use the setValue mathod.
To handle value changes both on click and through the API (setValue) use the onChange event.
Snippet is here: Code Snippet
Please, pay attention, the initial option (specified as value) won’t be caught by onChange, to check it use onAfterRender
Here is the snippet: Code Snippet

Thanks, that’s exactly what I was looking for.