-
28 Aug 2012 5:27 AM #1
Ext.panel.Panel collapsible & padding
Ext.panel.Panel collapsible & padding
Hi ExtJS users,
I'm kind of new with ExtJS (working 4 full weeks with it) and I have a problem which I couldn't find in the docs.
I have a panel like this:
When I collapse the panel, the header changes it CSS "top" property on from 5px to 0px.HTML Code:Ext.define('BaseClass.MenuGroup', { extend: 'Ext.panel.Panel', alias: 'widget.menugroup', collapsible: true, layout: 'anchor', padding: '5' });
Where can I define this css property? I don't want to mess with ext-all.css
Thank you
-
28 Aug 2012 6:54 AM #2
I'm not encountering this behavior. Can you please post a functional code sample?
-
28 Aug 2012 7:39 AM #3
Moving this to our bugs forum since it is an inconsistency in the way padding is handled on the panel element. Here is a working test case:
The use of padding on the main panel element is interesting since all the visible panel elements show inside the padding, including the header and body. If your intention is to add space around the panel, I'd recommend using margin instead of padding. If you want space inside the panel body use the bodyPadding config.Code:Ext.onReady(function() { Ext.create('Ext.panel.Panel', { title: 'foo', html: 'bar', collapsible: true, padding: 5, renderTo: document.body }); });Phil Guerrant
Ext JS - Development Team
-
29 Aug 2012 12:08 AM #4
Thanks for your replies.
@friend: JSFiddle is not letting me create a working example.
@Phil: Yes, I want spacing around the panel. The solution was indeed replacing padding to margin.
Even though my problem is solved, I still find this behaviour weird.
You found a bug! We've classified it as
EXTJSIV-7113
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote