AttachEvent to item created with addListOption

I have a toolbar with a bunch of button type ListOptions i created with addListOption like this:

app.menuTBMain.addListOption(“seasonSelect”, obj.id, nPos, “button”, obj.text);

How do i attach the event for these programatically created items? I cannot seem to make it work.

Thanks
Justin

the onClick event works well for the list options:
docs.dhtmlx.com/api__dhtmlxtool … event.html
Could you please, clarify your issue, or provide a more detailed snippet of the code, demo link or a complete demo, where the problem can be reconstructed.

My current events are setup on toolbar load like this.

“options”:[{“id”:“btnSeason2015”, “type”:“button”, “text”:“2015”, “action”: “app_doChangeSeason”}, {“id”:“btnSeason2016”, “type”:“button”, “text”:“2016”, “action”: “app_doChangeSeason”}]

When I set the event handler like your sample code it overrides all event handlers for all other toolbar buttons as well. How do I attach the event to the single select list item?

Unfortunately the “action” attribute adding is not available in case of the addListOption() method usage. Pleas,e try to use the onClick attachEvent usage.
It is not overriding the functions from the “action” property.
If the problem still occurs for you please, provide a complete demo or share a demo link, where the problem can be reproduced locally.