Sample: dhtmlxToolbar Two-State Button Creation dhtmlxToolbar main page
X
Position
Text
Image
Add?
 
<script>
 
    var webBar = new dhtmlXToolbarObject("toolbarObj");
    ...
    // adding a two-state button
    webBar.addButtonTwoState(itemId, pos, text, imgEnabled, imgDisabled);
    // removing a two-state button
    webBar.removeItem(itemId);
</script>