DHTMLX Front-end framework build one of your application tutorials (iv)-Add a toolbar toolbar

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.