zoukankan      html  css  js  c++  java
  • EXTJS学习系列提高篇:第十三篇(转载)作者殷良胜,利用Ext实现Icon小图标的部分用法

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

    //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",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,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,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,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());});
    }

    版权说明

      如果标题未标有<转载、转>等字则属于作者原创,欢迎转载,其版权归作者和博客园共有。
      作      者:温景良
      文章出处:http://wenjl520.cnblogs.com/  或  http://www.cnblogs.com/

  • 相关阅读:
    跳表(SkipList)及ConcurrentSkipListMap源码解析
    动态主机配置协议DHCP
    电子邮件
    万维网WWW
    运维技巧(4):管理邮箱收发限制
    运维技巧(3):管理邮箱配额限制:重点是powershell命令操作
    运维技巧(2):创建邮箱方法详解
    运维技巧(1):如何通过邮件头和传输跟踪日志查看原始客户端IP
    管理客户端连接(6):客户端软件可以连接上邮箱
    配置Exchange 防病毒和反垃圾邮件(9)
  • 原文地址:https://www.cnblogs.com/wenjl520/p/1325618.html
Copyright © 2011-2022 走看看