admin管理员组文章数量:1022794
I'm working with extjs 2.2.1, having a bit of a trouble adding a button into a box ponent class. From my understanding, because box ponent extends the ponent class, it has no config options that allow an item to be added. So the code below does not work...
new Ext.Viewport({
layout : 'border',
items : [new Ext.BoxComponent({
region : 'north',
el : 'north',
height : 50,
items : new Ext.Button({
iconCls : 'logout',
text : 'logout',
tooltip : 'logout',
handler : function() { }
}, mainTabPanel])
});
Is there a workaround where I can can add a button into this northern region that is made up of a boxponent class? Any help in the right direction is greatly appreciated. Thank you.
I'm working with extjs 2.2.1, having a bit of a trouble adding a button into a box ponent class. From my understanding, because box ponent extends the ponent class, it has no config options that allow an item to be added. So the code below does not work...
new Ext.Viewport({
layout : 'border',
items : [new Ext.BoxComponent({
region : 'north',
el : 'north',
height : 50,
items : new Ext.Button({
iconCls : 'logout',
text : 'logout',
tooltip : 'logout',
handler : function() { }
}, mainTabPanel])
});
Is there a workaround where I can can add a button into this northern region that is made up of a boxponent class? Any help in the right direction is greatly appreciated. Thank you.
Share Improve this question edited Sep 12, 2009 at 2:31 Wouter van Nifterick 24.1k7 gold badges81 silver badges123 bronze badges asked Jul 27, 2009 at 23:53 SnowrightSnowright 6254 gold badges15 silver badges22 bronze badges2 Answers
Reset to default 3BoxComponent doesn't have the ability to contain child items, if you look at the docs you'll see there isn't a configuration option to do that. You will need to use a Container (or some subclass thereof) to get this effect.
There was no way around having child items in a BoxComponent class as it is not a container. so instead, I changed the BoxComponent to a container class, like Panel, that allowed me to add a button class.
new Ext.Viewport({
layout : 'border',
items : [new Ext.Panel({
region : 'north',
applyTo : 'north',
height : 50,
items : new Ext.Button({
iconCls : 'logout',
text : 'logout',
tooltip : 'logout',
handler : function() { }
}, mainTabPanel])
});
I'm working with extjs 2.2.1, having a bit of a trouble adding a button into a box ponent class. From my understanding, because box ponent extends the ponent class, it has no config options that allow an item to be added. So the code below does not work...
new Ext.Viewport({
layout : 'border',
items : [new Ext.BoxComponent({
region : 'north',
el : 'north',
height : 50,
items : new Ext.Button({
iconCls : 'logout',
text : 'logout',
tooltip : 'logout',
handler : function() { }
}, mainTabPanel])
});
Is there a workaround where I can can add a button into this northern region that is made up of a boxponent class? Any help in the right direction is greatly appreciated. Thank you.
I'm working with extjs 2.2.1, having a bit of a trouble adding a button into a box ponent class. From my understanding, because box ponent extends the ponent class, it has no config options that allow an item to be added. So the code below does not work...
new Ext.Viewport({
layout : 'border',
items : [new Ext.BoxComponent({
region : 'north',
el : 'north',
height : 50,
items : new Ext.Button({
iconCls : 'logout',
text : 'logout',
tooltip : 'logout',
handler : function() { }
}, mainTabPanel])
});
Is there a workaround where I can can add a button into this northern region that is made up of a boxponent class? Any help in the right direction is greatly appreciated. Thank you.
Share Improve this question edited Sep 12, 2009 at 2:31 Wouter van Nifterick 24.1k7 gold badges81 silver badges123 bronze badges asked Jul 27, 2009 at 23:53 SnowrightSnowright 6254 gold badges15 silver badges22 bronze badges2 Answers
Reset to default 3BoxComponent doesn't have the ability to contain child items, if you look at the docs you'll see there isn't a configuration option to do that. You will need to use a Container (or some subclass thereof) to get this effect.
There was no way around having child items in a BoxComponent class as it is not a container. so instead, I changed the BoxComponent to a container class, like Panel, that allowed me to add a button class.
new Ext.Viewport({
layout : 'border',
items : [new Ext.Panel({
region : 'north',
applyTo : 'north',
height : 50,
items : new Ext.Button({
iconCls : 'logout',
text : 'logout',
tooltip : 'logout',
handler : function() { }
}, mainTabPanel])
});
本文标签: javascriptAdding an ExtButton class into a Box ComponentStack Overflow
版权声明:本文标题:javascript - Adding an Ext.Button class into a Box Component - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745516087a2154059.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论