【问题标题】:Toolbar in Ext Js 4Ext Js 4 中的工具栏
【发布时间】:2013-10-31 16:18:26
【问题描述】:

我是 Ext Js 的新手。我正在尝试在工具栏中创建菜单按钮和拆分按钮。这是我的代码

Ext.onReady(function(){
    new Ext.Toolbar({
        renderTo: document.body,
        items: [{
            xtype: 'tbbutton',
            text: 'Button'
        },{
            xtype: 'tbbutton',
            text: 'Menu Button',
            menu: [{
                text: 'Better'
            },{
                text: 'Good'
            },{
                text: 'Best'
            }]
        },{
            xtype: 'tbsplit',
            text: 'Split Button',
            menu: [{
                text: 'Item One'
            },{
                text: 'Item Two'
            },{
                text: 'Item Three'
            }]
        }]
    });
});

当我在ext-4.2.1.883 包中运行上述代码时,它没有显示所需的工具栏。请帮忙

【问题讨论】:

    标签: extjs toolbar


    【解决方案1】:

    你使用了错误的 xtypes,使用:

    【讨论】:

    • 感谢它有效。我使用'Learning Ext Js - Shea Frederick & Colin Ramsay _199' pdf 作为参考,但我认为这本书使用了旧的 extjs 包。能否请您推荐一本适合我学习的好书?
    • 您提到的 PDF 似乎来自 2008 年 11 月,所以它可能指的是 ExtJS 2 或 3。恐怕这在很多方面都会过时,所以我不会依赖它作为一个学习资源。一个好的起点可能是官方文档中的guides。另请查看examples,其中有很多。
    • 非常感谢您的建议。然后我会按照官方文档进行操作。 :)
    猜你喜欢
    • 2012-06-21
    • 2014-09-15
    • 2023-03-21
    • 1970-01-01
    • 2011-06-22
    • 2013-08-22
    • 1970-01-01
    • 1970-01-01
    • 2018-07-16
    相关资源
    最近更新 更多