Tool Bar Example
The sample is as follows:
Here we are using the Dhtmlxtoolbar component.
To add a toolbar to the layout:
1. Use the Attachtoolbar () method to initialize the page to add code to index.html
Dhtmlxevent (window, "load",function() { varnew Dhtmlxlayoutobject ( Document.body, "2U"); Layout.cells ("a"). SetText ("Contacts"); Layout.cells ("B"). SetText ("Contact Details"); Layout.cells ("B"). SetWidth (+); var menu = layout.attachmenu (); Menu.seticonspath ("icons/"); Menu.loadstruct ("Data/menu.xml"); var
});
2. Add the "toolbar.xml" file to the Data folder
3. Add code to the XML file
<?XML version= "1.0"?><Toolbar> <ItemID= "NewContact"type= "button"img= "Add_contact.gif"/> <ItemID= "Delcontact"type= "button"text= "Delete"img= "Delete_contact.gif"/> <ItemID= "Sep01"type= "Separator"/> <ItemID= "Help"type= "button"text= "Help"/></Toolbar>
4. Set the custom picture path
Toolbar.seticonspath ("icons/");
5. Loading data with the Loadstruct () method
Toolbar.loadstruct ("Data/toolbar.xml");
DHTMLX Front-end framework build one of your application tutorials (iv)-Add a toolbar toolbar