里面为什么又要放个items呢?我以前用ext3.2的
var panel = new Ext.panel.Panel({
    dockedItems: [{
        xtype: 'toolbar',
        dock: 'top',
        items: [{
            text: 'Docked to the top'
        }]
    }]
});

解决方案 »

  1.   

    dockedItems里面不是还有个dock属性么,可以设置上下左右的dock部件,你这里针对top的dock部件里面需要增加子部件就是放在items里面了。
      

  2.   

    举个例子就清楚了:
    var panel = new Ext.panel.Panel({
        dockedItems: [{
            xtype: 'toolbar',
            dock: 'top',
            items: [{
                text: 'Docked to the top'
            },{
            xtype: 'toolbar',
            dock: 'boottom',
            items: [{
                text: 'Docked to the bottom'
            }]
        }]
    });
      

  3.   

    对该段代码解释就是在panel顶部放一个与panel同宽度的toolbar,在toolbar上放一个子部件,text为'Docked to the top'当然在toolbar上也可以添加其他的部件
      

  4.   

    A component or series of components to be added as docked items to this panel. The docked items can be docked to either the top, right, left or bottom of a panel. This is typically used for things like toolbars or tab bars:var panel = new Ext.panel.Panel({
        dockedItems: [{
            xtype: 'toolbar',
            dock: 'top',
            items: [{
                text: 'Docked to the top'
            }]
        }]
    });
    API上面的解释很好!
      

  5.   

    效果是topbar上有文本:Docked to the bottom, 居右显示了