Get value of selectbutton in toolbar

Hi,
I’m starting with dhtmlx 6 now and I’m trying to get the value of a selectbutton in a toolbar after it changes. Unfortunatly I haven’t found any documentation on it.
Can you please help me with this?

I think you may be looking for a combination of the “click” event (using an array of the IDs of the select button’s items to limit the behavior) and the getState() function of the toolbar.

Snippet for demonstration

I posted the same problem and a solution is to deal with openmenu event on select button with sub items.
I am still working about it, but if you would read the answer, here is the link:

Thank you for your report. The problem is confirmed. We’ll try to extend this behavior in the future updates.

We have extended the getState method allowing to return the selected option of the specified control:
https://snippet.dhtmlx.com/whp6b5sx
So now you don’t have to search the need econtrol in the getState result.

1 Like