ExtJs 图标应用

还是先看看效果图吧 图片总是在恰当的时候可以说明一切

//Button图标         
        

var btn = new Ext.Button
 ({
       text:"button图标",cls: 'x-btn-text-icon',icon:"../Images/Menus/house.png",
       renderTo:"btnIcon"
});

//Menu图标

var  menu = new Ext.menu.Menu
({
     items:
     [
        {  id: 'close',icon:"../Images/Menus/house.png",text: '关闭',handler : function(){alert('good');}},
        {  id: 'open',icon:"../Images/Menus/house.png",text: '打开',handler : function(){alert('good');}}   
     ]
});

//Toolbar图标


var toolbar = new Ext.Toolbar
({
    id: 'tbControls',renderTo:"toolbarIcon",width:200,
    items: 
    [
        new Ext.Toolbar.Button
        ({
                id: 'btnChangePassword',text: '中国',
                icon: '../Images/Menus/house.png',                        
                cls: 'x-btn-text-icon'
                
        }),
        new Ext.Toolbar.Button
        ({
                id: 'btnLogOut',text: '美国',                        
                icon: '../Images/Menus/house.png',
                cls: 'x-btn-text-icon'
        }),
        {xtype:"button",text:"加拿大",cls: 'x-btn-text-icon',icon: '../Images/Menus/house.png'}
    ]
});

 //Panel 图标

var panel = new Ext.Panel
({
    iconCls :"panel_icon",title:"Panel图标",height:200,contentEl:"Img1"
});

 //TabPanel图标的添加 

 

var tabPanel = new Ext.TabPanel
({
   x:500,y:200,width:300,height:200,activateItem:0,
   items:[{title:"工作",iconCls:"panel_icon"},{title:"休闲",iconCls:"panel_icon"}],
   renderTo:"BuildMenu4"
});

//Window图标

var win = new Ext.Window
({
    title:"测试窗口",x:0,y:100,width:300,height:300,iconCls :"panel_icon",               
    contentEl:"leftImg"
});
win.show();

 //contextmenu图标
 

function BuildMenu()
{
     var menu = new Ext.menu.Menu
     ({
          items:
          [
              {text:"添加",icon:"../Images/Menus/house.png"},
              {text:"编辑",icon:"../Images/Menus/house.png"},
              {text:"删除",icon:"../Images/Menus/house.png"},
              {text:"取消",icon:"../Images/Menus/house.png"},
              {text:"退出",icon:"../Images/Menus/house.png"}
          ]
     }); 
     var tabPanel = new Ext.TabPanel
     ({
           x:500,y:200,width:200,height:100,activateItem:0,
           items:[{title:"主题",iconCls:"panel_icon"}],
           renderTo:"BuildMenu4"
     });
     tabPanel.on("contextmenu",function(main,tab,e){e.preventDefault();menu.showAt(e.getPoint());});
}

转载于:https://www.cnblogs.com/sfmjp/articles/2848668.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值