Extjs 4将工具栏添加到面板dockeditems运行时
我想在创建面板后创建一个停靠项目工具栏:
Ext.onReady(function() {
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'center',
xtype: 'panel',
listeners: {
afterrender: function(panel) {
//Below gives: Uncaught TypeError: Object #<Object> has no method 'getItemId'
panel.dockedItems.add({
xtype: 'toolbar',
dock: 'bottom',
items: [{
text: 'adfsadf'
}]
});
}
}
}, {
region: 'west',
title: 'west',
html: 'west',
width: 120
}, {
region: 'east',
title: 'east',
html: 'east',
width: 120
}, {
region: 'north',
html: 'north',
title: 'north',
height: 60
}, {
region: 'south',
html: 'south',
title: 'south',
height: 60
}]
});
});
错误是:
Uncaught TypeError: Object #<Object> has no method 'getItemId'
关于如何执行此操作的任何想法?
I want to create a dockedItem toolbar after the panel has been created:
Ext.onReady(function() {
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'center',
xtype: 'panel',
listeners: {
afterrender: function(panel) {
//Below gives: Uncaught TypeError: Object #<Object> has no method 'getItemId'
panel.dockedItems.add({
xtype: 'toolbar',
dock: 'bottom',
items: [{
text: 'adfsadf'
}]
});
}
}
}, {
region: 'west',
title: 'west',
html: 'west',
width: 120
}, {
region: 'east',
title: 'east',
html: 'east',
width: 120
}, {
region: 'north',
html: 'north',
title: 'north',
height: 60
}, {
region: 'south',
html: 'south',
title: 'south',
height: 60
}]
});
});
The error is:
Uncaught TypeError: Object #<Object> has no method 'getItemId'
Any ideas on how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系...比我想象的要简单。
解决方案:
Never mind... was simpler than I thought.
Solution: