Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by h on Feb 09, 2009 01:15
open dhtmlx forum
dhtmlxToolbar

Hello! I have a problem with Toolbar.
What event occurs, when user change the selection in select button item? How can i catch this event?

p.s.: sorry for english:)
Answer posted by dhxSupport on Feb 10, 2009 08:59

When user click on the select button item "onClick" event occurs. 

webBar.attachEvent("onClick", function(id){});

id- id of select button option

Answer posted by h on Feb 09, 2009 10:33
Not push the button. But drop down the options (items in select button) and select one of it.
Answer posted by dhxSupport on Feb 10, 2009 09:13
When option selected inside select-box element inside toolbar it generates onClick event 
It is not a native HTML event, but event of toolbar, which can be handled as 

For 
<?xml version="1.0"?>
<toolbar>
    <item id="history" type="buttonSelect" text="History">
        <item type="button" id="today" text="Today"/>
        <item type="button" id="yesturday" text="Yesturday" selected="true"/>
        <item type="button" id="lastweek" text="Last Week"/>
        <item type="button" id="lastmonth" text="Last Month"/>
        <item id="sep1" type="separator"/>
        <item type="button" id="more" img="list/red.gif" text="More..."/>
    </item>


webBar.attachEvent("onClick", function(id){
    if (id=="today") alert("today element was selected in selectbox");
});