PDA

View Full Version : [FIXED-424][3.??] Panel with 'hbox' layout does not render in Ext.menu.Menu



dzwillia
14 Jan 2010, 9:55 AM
Hello,

The latest ability to render an Ext.Panel in an Ext.menu.Menu without having to use Ext.menu.Adapter is great! I've encountered a bug when using an 'hbox' layout in this configuration. Apparently any panel with an 'hbox' layout doesn't render at all. It appears the same issue exists when using a 'vbox' layout, although I haven't tested it as rigorously. I've modified my code to use the 'column' layout instead for the time being, but would prefer to use the 'hbox' layout.

This code works (using 'column' layout):



Ext.ux.form.MyTriggerField = Ext.extend(Ext.form.TriggerField, {
width: 300,

onTriggerClick : function() {
if(this.disabled){
return;
}
if(this.menu == null) {
this.menu = new Ext.menu.Menu({
showSeparator: false,
plain: true,
autoHeight: true,
forceLayout: true,
enableScrolling: false,
items: [{
xtype: 'panel',
layout: 'column',
border: false,
width: 300,
height: 50,

items: [{
xtype: 'textfield',
value: 'Field 1',
width: 150
},{
xtype: 'textfield',
value: 'Field 2',
width: 150
}]
}]
})
}
this.onFocus();
this.menu.show(this.el, "tl-bl?");
}
});
This code does not work (using 'hbox' layout):


Ext.ux.form.MyTriggerField = Ext.extend(Ext.form.TriggerField, {
width: 300,

onTriggerClick : function() {
if(this.disabled){
return;
}
if(this.menu == null) {
this.menu = new Ext.menu.Menu({
showSeparator: false,
plain: true,
autoHeight: true,
forceLayout: true,
enableScrolling: false,
items: [{
xtype: 'panel',
layout: 'hbox',
border: false,
width: 300,
height: 50,

items: [{
xtype: 'textfield',
value: 'Field 1',
width: 150
},{
xtype: 'textfield',
value: 'Field 2',
width: 150
}]
}]
})
}
this.onFocus();
this.menu.show(this.el, "tl-bl?");
}
});
Thanks in advance.

All the best,
Dave.

--
OS: Mac OS X 10.6
Browser: Firefox 3.5.7
Ext JS: 3.0.0 and 3.1.0 (both exhibit the same problem)

Jamie Avins
14 Jan 2010, 10:52 AM
You are using hbox with all fixed widths. Why do you need hbox here?

dzwillia
14 Jan 2010, 11:30 AM
I have a far more involved example in my own code, but wanted to cull the code down to its most basic form for easier bug testing.

One can very easily imagine both of those text fields having "flex: 1", etc. as a property. The point is... even if you were to add "flex: 1", etc. to the contained text fields, the panel is still not showing up in the menu, which is what the main issue is.

Jamie Avins
14 Jan 2010, 12:08 PM
I'll bug it and see what's up.

Jamie Avins
19 Jan 2010, 2:16 PM
Working well in svn 5918.

dzwillia
20 Jan 2010, 9:12 AM
Thanks! I'll have to check it out when the latest dot release comes out.