zoukankan      html  css  js  c++  java
  • 学习EXTJS6(6)基本功能-工具栏和菜单

    <!DOCTYPE html>
    <html>
       <head>
        <meta http-equiv="Content-Type"  content="text/html;charset=utf-8">
        <link rel="stylesheet" type="text/css" href="../../study/EXTJS/ext-4.2.1.883/resources/css/ext-all.css" />
        <script type="text/javascript" src="../../study/EXTJS/ext-4.2.1.883/bootstrap.js"></script>
        <script type="text/javascript" src="../../study/EXTJS/ext-4.2.1.883/locale/ext-lang-zh_CN.js"></script>
     <script type="text/javascript">  
        Ext.onReady(function(){
    var toolbar = new Ext.toolbar.Toolbar({
        renderTo : 'toolbar',
        vertical :true,
        enableOverflow : true,
        width : 300});
    
        toolbar.add([
            {
                text : 'hello usegear',
                handler : onButtonClick,
                iconCls : 'newIcon'
            },
            {text:'open',handler:onButtonClick,iconCls:'openIcon'},
            {text:'save',handler:onButtonClick,iconCls:'saveIcon'}
            ]);
        function onButtonClick(btn){
            alert(btn.text);
            }
    
        });
    
    
    </script>
       </head>
       <body>
    <div id='toolbar'></div>
            </body>
    </html>
    包含按钮的简单工具栏

    效果:

    拓展思路:

    <!DOCTYPE html>
    <html>
       <head>
        <meta http-equiv="Content-Type"  content="text/html;charset=utf-8">
        <link rel="stylesheet" type="text/css" href="../../study/EXTJS/ext-4.2.1.883/resources/css/ext-all.css" />
        <script type="text/javascript" src="../../study/EXTJS/ext-4.2.1.883/bootstrap.js"></script>
        <script type="text/javascript" src="../../study/EXTJS/ext-4.2.1.883/locale/ext-lang-zh_CN.js"></script>
     <script type="text/javascript">  
        Ext.onReady(function(){
    var toolbar = new Ext.toolbar.Toolbar({
        renderTo : 'toolbar',
        vertical :true,
        enableOverflow : true,
        width : 300});
    
        toolbar.add([
            {text : 'hello usegear',handler : onButtonClick,iconCls : 'newIcon'},
            {text:'open',handler:onButtonClick,iconCls:'openIcon'},
            {text:'save',handler:onButtonClick,iconCls:'saveIcon'},
    {
        xtype:"radio",
        fieldLabel:"Label",
        boxLabel:"Box label",
        name:"radio",
        inputValue:"radiovalue"
      },{
        xtype:"checkbox",
        fieldLabel:"Label",
        boxLabel:"Box label",
        name:"checkbox",
        inputValue:"cbvalue"
      },{
        xtype:"datefield",
        fieldLabel:"Date",
        name:"datevalue"
      },{
        xtype:"timefield",
        fieldLabel:"Time",
        name:"timevalue"
      },{
        xtype:"numberfield",
        fieldLabel:"Number",
        name:"numbervalue"
      },{
        xtype:"textfield",
        fieldLabel:"Text",
        name:"textvalue"
      },{
        xtype:"combo",
        fieldLabel:"Text",
        name:"combovalue",
        hiddenName:"combovalue"
      },{
        xtype:"fieldset",
        title:"Legend",
        autoHeight:true
      },
            
            {xtype:"panel",
    text:"Panel",
    items:[{
        xtype:"checkbox",
        boxLabel:"Box label",
        name:"checkbox",
        inputValue:"cbvalue"
      },{
        xtype:"radio",
        boxLabel:"Box label",
        name:"radio",
        inputValue:"radiovalue"
      },{
        xtype:"checkbox",
        boxLabel:"Box label",
        name:"checkbox",
        inputValue:"cbvalue"
      }]
      }
      ]
            
            
            
            );
        function onButtonClick(btn){
            alert(btn.text);
            }
    
        });
    
    
    </script>
       </head>
       <body>
    <div id='toolbar'></div>
            </body>
    </html>
    工具栏

    效果:

    http://www.tof2k.com/ext/formbuilder/,导出json参数,然后。。。相当方便。否则手工码砖,效率可知了。

     工具栏的启用和禁用,有二个方法:enable()和disable()

  • 相关阅读:
    我的知识库(4) java获取页面编码(Z)
    知识库(3)JAVA 正则表达式 (超详细)
    The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts
    某人总结的《英语听力的技巧 》,挺搞的
    我的知识库(5)java单例模式详解
    构建可扩展程序
    SerialPort (RS232 Serial COM Port) in C# .NET
    Python学习笔记——String、Sequences
    UI题目我的答案
    jQuery学习系列学会操纵Form表单元素(1)
  • 原文地址:https://www.cnblogs.com/usegear/p/7765526.html
Copyright © 2011-2022 走看看