PDA

View Full Version : Header config for a window erroring



castitas
20 Mar 2014, 8:41 AM
I have a window where I would like to replace its header with a toolbar:


var win = Ext.create('Ext.window.Window', {
header: {
xtype:'toolbar'
}
items: [{
type: 'panel',
layout: 'hbox',
border: false,
items: [
imageObj
,{
xtype:'form',
name: 'event-form',
border:false,
padding: '3 3 3 3',
html:'',
items: []
}]
},],
buttons:myButtons
});


However, I am getting this error:
TypeError: el is undefined.........................................................ext-all-dev.js (line 35626)


value = el.getById(baseId + childName);


Tracing back, I found the toolbar is created, it's just missing an el. Does anyone know what's going on, or what I may be doing wrong?

Gary Schlosberg
21 Mar 2014, 9:38 AM
Probably easier to use a panel since your main item is a panel anyway. You can use tbar (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Panel-cfg-tbar) and bbar (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Panel-cfg-bbar) to place your buttons. You might also look at the tools (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Panel-cfg-tools) config.
https://fiddle.sencha.com/#fiddle/4ec

EvaCooper
21 Mar 2014, 11:30 AM
Very interesting!!

castitas
24 Mar 2014, 11:24 AM
Easier, yes, but I'm replacing the header because I'm trying to minimize the vertical space. I had looked (briefly) at tools, but I was looking for an simpler alternative to extending a class (and you can't add tools to the left side of a header, can you?). We decided to drop the feature for the time being.

Thanks for your reply