ExtJS4中的工具栏

ExtJS4中的工具栏,extjs,toolbar,Extjs,Toolbar,我是Ext Js的新手。我试图在工具栏中创建菜单按钮和拆分按钮。这是我的密码 Ext.onReady(function(){ new Ext.Toolbar({ renderTo: document.body, items: [{ xtype: 'tbbutton', text: 'Button' },{ xtype: 'tbbutton', t

我是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
软件包中运行上述代码时,它没有显示所需的工具栏。请帮助

如果您使用了错误的X类型,请使用:

  • 而不是“tbbutton”
  • 而不是“tbsplit”

谢谢,它很管用。我使用“Learning Ext Js-Shea Frederick&Colin RamsayÇu 199”pdf作为参考,但我认为这本书使用了extjs的旧软件包。你能给我推荐一本学习用的好书吗?你提到的PDF似乎是2008年11月的,所以它可能指的是ExtJS2或3。我担心这在很多方面都会过时,所以我不会把它作为学习资源。一个好的起点可能是官方文件中的。也可以看看,有很多。非常感谢你的建议。我会遵循官方文件的规定。:)