PDA

View Full Version : Panel Header creation via config ...



bcarollo
8 Jan 2013, 12:02 AM
Hi All,

I'm trying to create an header within a panel using a config in the following way :


Ext.define("ReadingWorkspaceUXPrototype.view.ViewBase", {
extend: 'Ext.panel.Panel',
alias: 'widget.viewbase',
layout: 'fit',
draggable: {
moveOnDrag: false
},
header:{
layout: 'border',
style: {
overflow: 'visible'
},
items: [
{ region: 'center',
xtype: 'button',
text: 'I like Ext',
menu: {
floating: 'true',
items: [
{
text: 'I Like Extjs',
checked: true
},
{
xtype: 'menuseparator'
},
{
text: 'Radio Options',
menu: { // <-- submenu by nested config object
title: 'Options',
items: [
{
text: 'Option 01',
checked: true,
group: 'option'
},
{
text: 'Option 02',
checked: false,
group: 'option'
},
{
text: 'Option 03',
checked: false,
group: 'option'
},
{
text: 'Option 04',
checked: false,
group: 'option'
}
]
}
}

]
}
},
{
region: 'east',
xtype: 'tool',
type:'linktool',
tooltip: 'Your tooltip',
handler: function(event, toolEl, panel){
// Your handler function
}
}
]
},
...


but unfortunately I'm getting the following error :



Uncaught TypeError: Object #<Object> has no method 'hide' ext-all-debug-w-comments.js:70555

Ext.define.updateHeaderext-all-debug-w-comments.js:70555
Ext.define.beforeRenderext-all-debug-w-comments.js:70405
Ext.define.getRenderTreeext-all-debug-w-comments.js:29757
Ext.define.renderext-all-debug-w-comments.js:29953
Ext.define.renderItemext-all-debug-w-comments.js:39883
Ext.define.renderItemsext-all-debug-w-comments.js:39827
Ext.define.renderChildrenext-all-debug-w-comments.js:39808
Ext.define.invalidateext-all-debug-w-comments.js:147302
Ext.define.invalidateext-all-debug-w-comments.js:147306
Ext.define.invalidateext-all-debug-w-comments.js:147306
Ext.define.invalidateext-all-debug-w-comments.js:147306
Ext.define.invalidateext-all-debug-w-comments.js:147306
Ext.define.flushInvalidatesext-all-debug-w-comments.js:147142
Ext.define.runext-all-debug-w-comments.js:147667
Ext.define.statics.flushLayoutsext-all-debug-w-comments.js:31000
Ext.define.statics.resumeLayoutsext-all-debug-w-comments.js:31016
Ext.resumeLayoutsext-all-debug-w-comments.js:34334
Ext.define.renderext-all-debug-w-comments.js:29989
Ext.define.constructorext-all-debug-w-comments.js:32042
Base.implement.callParentext-all-debug-w-comments.js:6194
Ext.define.constructorext-all-debug-w-comments.js:36461
constructorext-all-debug-w-comments.js:7356
(anonymous function)
Ext.ClassManager.instantiateext-all-debug-w-comments.js:8059
(anonymous function)ext-all-debug-w-comments.js:2974
Ext.apply.createext-all-debug-w-comments.js:5419
Ext.define.onBeforeLaunchext-all-debug-w-comments.js:73448
(anonymous function)ext-all-debug-w-comments.js:73417
(anonymous function)ext-all-debug-w-comments.js:13981
Ext.util.Event.Ext.extend.fireext-all-debug-w-comments.js:14134
Ext.apply.readyEvent.event.fireext-all-debug-w-comments.js:16667
Ext.apply.fireReadyEventext-all-debug-w-comments.js:16765
Ext.apply.onDocumentReadyext-all-debug-w-comments.js:16789
fnext-all-debug-w-comments.js:9861
Ext.apply.triggerReadyext-all-debug-w-comments.js:9847
Ext.apply.requireext-all-debug-w-comments.js:9713
Ext.apply.triggerReadyext-all-debug-w-comments.js:9835
Ext.apply.refreshQueueext-all-debug-w-comments.js:9357
Ext.apply.refreshQueueext-all-debug-w-comments.js:9387
Ext.apply.refreshQueueext-all-debug-w-comments.js:9387
Ext.apply.refreshQueueext-all-debug-w-comments.js:9387
Ext.apply.refreshQueueext-all-debug-w-comments.js:9387
Ext.apply.refreshQueueext-all-debug-w-comments.js:9387
Ext.apply.refreshQueueext-all-debug-w-comments.js:9387
Ext.apply.onFileLoadedext-all-debug-w-comments.js:9785
(anonymous function)ext-all-debug-w-comments.js:2960
onLoadFnext-all-debug-w-comments.js:9413




but if I include "closable: true" in the panel configuration everything works well with the exception that the layout that I've specified for the header (border with the button on the center and the tool on the left) is not respected
Here is a picture of what I'm getting with closable set to true :
http://www.sencha.com/forum/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATcAAAC0CAIAAAB+E/ynAAAE+0lEQVR4nO3cQVLiWADH4Se0z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kE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkE6lkK6/UpvNdvWtK9J/AX3B6iEub1lgAAAAAElFTkSuQmCC

Any idea of what could be ?

Thanks a lot for your help.

Kind regards

Ben

mitchellsimoens
10 Jan 2013, 9:54 AM
Running this code with 4.1.3 works so a bug has been fixed to support this.

bcarollo
10 Jan 2013, 11:35 PM
Thanks a lot for your answer.

Have a nice weekend

Ben