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. }
ExtJS中Ext.menu.Menu菜单应用

  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. });
ExtJS中Ext.menu.Menu菜单应用
ExtJS中Ext.menu.Menu菜单应用
  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"

你可能感兴趣的:(ExtJs)