var myToolbar = new dhtmlXToolbarObject(parent, skin);
where
<div id='my_toolbar_here' style="width: 500px;"></div>
<script>//common init code
var myToolbar = new dhtmlXToolbarObject("my_toolbar_here");
</script>
Toolbar can also be initialized by object notation:
myToolbar = new dhtmlXToolbarObject({
parent:"a_toolbar",
onClick:function(){
alert("Toolbar item was clicked");
}
});
Toolbar's items can be defined through items collection
myToolbar = new dhtmlXToolbarObject({
parent:"a_toolbar",
items:[
{id: "new", type: "buttonSelect", text: "New", img: "new.gif",
img_disabled: "new_dis.gif"},
{id: "sep1", type: "separator" },
{id: "open", type: "button", img: "open.gif"},
{id: "autosave", type: "buttonTwoState", text: "Autosave", img: "save.gif"},
{id: "inp", type: "buttonInput", text: "Input"},
{id: "sld", type: "slider", text_min: "10 MBit", text_max: "100 MBit"},
{id: "info", type: "text", text: "dhtmlxToolbar Demo"}
]
});
Each item can have the following attributes:
Related sample: Object API extended init
Back to top