ExtJS中Ext.menu.Menu菜单应用



  1. var menu = new Ext.menu.Menu();
  2. menu.add
  3. (
  4.     {
  5.       text:"字号",
  6.       menu:
  7.       [
  8.          new Ext.menu.CheckItem({text:"大",group:"font"}),
  9.          new Ext.menu.CheckItem({text:"中",group:"font"}),
  10.          new Ext.menu.CheckItem({text:"小",group:"font"})
  11.       ]
  12.     },
  13.     {
  14.       text:"字体",
  15.       menu:
  16.       [
  17.          new Ext.menu.CheckItem({text:"加粗"}),
  18.          new Ext.menu.CheckItem({text:"斜体"})
  19.       ]
  20.     }
  21. }


  1. var btn1 = new Ext.Button
  2. ({
  3.    text:"文件",cls: 'x-btn-text-icon',icon:"../Images/Menus/house.png",
  4.    menu:
  5.    [
  6.    {text:"打开",icon:"../Images/Menus/house.png"},
  7.    {text:"保存",icon:"../Images/Menus/house.png"},
  8.    {text:"删除"},
  9.    {text:"关闭"},
  10.    {text:"退出"}
  11.    ]
  12. });
  13. var btn2 = new Ext.Button
  14. ({
  15.    text:"编辑",cls: 'x-btn-text-icon',icon:"../Images/Menus/house.png",
  16.    menu:
  17.    [
  18.    {text:"复制",icon:"../Images/Menus/house.png"},
  19.    {text:"拷贝",icon:"../Images/Menus/house.png"},
  20.    '-',
  21.    {text:"查找"},
  22.    {text:"替换"}
  23.    ]
  24. });
  25. var toolbar = new Ext.Toolbar
  26. ({
  27. width:300,height:200,items:[btn1,btn2],renderTo:"BuildMenu5"
  28. });


  1. var btn = new Ext.Button
  2. ({
  3. text:"其它",cls: 'x-btn-text-icon',icon:"../Images/Menus/house.png",
  4. menu:
  5. [
  6.    {text:"选择日期",icon:"../Images/Menus/house.png",menu:new Ext.menu.DateMenu()},
  7.    {text:"选择颜色",icon:"../Images/Menus/house.png",menu:new Ext.menu.ColorMenu()}
  8. ]
  9. });
  10. var toolbar = new Ext.Toolbar
  11. ({
  12. width:300,height:200,items:[btn],renderTo:"BuildMenu5"
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值