码迷,mamicode.com
首页 > Web开发 > 详细

ExtJS 4 【Ext.toolbar.Toolbar】

时间:2016-11-19 15:59:37      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:space   .text   idt   链接   ide   handle   str   cti   ace   

技术分享
<input type="button" id="EnableToolbar" value="启用工具栏" />
<input type="button" id="DisableToolbar" value="停用工具栏" />
<br/>
<div id="toolbar"></div>
Ext.onReady(function () {
    var toolbar = new Ext.toolbar.Toolbar({
        renderTo: ‘toolbar‘
    });
    toolbar.add([
       {
           text: ‘新建‘,
           handler: onButtonClick
       }, {
           text: ‘打开‘,
           handler: onButtonClick
       }, {
           text: ‘保存‘,
           handler: onButtonClick
       }, ‘-‘,
       {
           xtype: ‘textfield‘,
           hideLabel: true,
           width: 150
       },
       ‘->‘,
       ‘<a href=#>超链接</a>‘,
       { xtype: ‘tbspacer‘, width: 50 },
       ‘静态文本‘
    ]);
    function onButtonClick(btn) {
        alert(btn.text);
    }

    Ext.get(‘EnableToolbar‘)
        .on(‘click‘,
            function () {
                toolbar.enable();
            });
    Ext.get(‘DisableToolbar‘)
       .on(‘click‘,
           function () {
               toolbar.disable();
           });

});

 

 

 

 

 

ExtJS 4 【Ext.toolbar.Toolbar】

标签:space   .text   idt   链接   ide   handle   str   cti   ace   

原文地址:http://www.cnblogs.com/CodingArt/p/6080512.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!