Webix.tree modifying icons

Source: Internet
Author: User

Today, I changed the icon of Easyui's tree with my work, and went home and tried to change the icon of Webix tree. The following demo is given in the document.

Webix.ui ({    view:"Tree",    type:{        folder:function(obj) {              If(obj. $level = =1                )return "<span class= ' Webix_icon fa-folder-open ' ></span > ";             if (obj. $level = =2                ) return "<span class= ' Webix_icon fa-video-camera ' ></span>";        }}    );

View the source code to discover that obj is the data for each node in data. His original icon seems to be a certain style, there is no overlay, imitate Easyui tree plus iconcls can change the icon to redefine the next type of Foder. As follows

Webix has a lot of icons, here are a few of the life of the icons often appear, the specific icon to see another essay. More than 500 kinds are listed. The code is as follows

<!DOCTYPE HTML><HTML><HeadLang= "en">    <MetaCharSet= "UTF-8">    <Linkrel= "stylesheet"href= "Http://cdn.webix.com/edge/webix.css"type= "Text/css"Media= "Screen"CharSet= "Utf-8">    <Scriptsrc= "Http://cdn.webix.com/edge/webix.js"type= "Text/javascript"CharSet= "Utf-8"></Script>    <title>Webix Tree Tags</title></Head><Body><Script>Webix.ui ({view:"Tree", Width:260, drag:true, type: {folder:  function  (obj) {  if  (obj.iconcls)  return "<span class= ' Webix_icon fa-" +  obj.iconcls  + " ' ></span> "; }}, data: [{open:true, Value:"Configuration Management", iconcls:  "cogs"  , data: [{iconcls:"COG", Value:"Stock Management"}, {iconcls:"Leaf", Value:"Shipping Management"}, {iconcls:"Heart", Value:"Configure Publishing"}]}, {value:"Report Management", open:true, Iconcls:"Bar-chart-o", data: [{iconcls:"QQ", Value:"Access Volume report"}]}, {value:"Account Management", Iconcls:"WeChat", open:true, data: [{iconcls:"Android", Value:"Personal account Management"}, {iconcls:"Apple", Value:"System Account Management"            }]        }],
On: {
"Onitemclick": function (ID) {
var item = This.getitem (ID);
Webix.alert ({title: "Hint", text:item.value});
}
}


</ Script >

</ Body >

</ HTML >

Red part of the code, is the key to change the icon, you can directly put in the HTML file, open to see the effect. There are many different styles of Webix, and I use Gray. You may be in color.

Webix is the JS front-end frame, the entire code except <body>. Almost all are JS,. If you are developing in single-page mode. Just write a index.html file. The entire system front-end can be completed with JS.

enough to 150. The number of words--------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- -----------------------------------------

Webix.tree Modify icon

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.