PDA

View Full Version : Panel's html config property



darthwes
26 Mar 2010, 12:14 PM
I never realized I couldn't render list items inside of ext components. Can I get someone to confirm this as the desired behavior, please?



var dwin = new Ext.Window({
title: 'Test Ext Stuff',
modal: true,
resizable: true,
padding: 6,
width: 600,
height: 500,
border: true,
items:[{
xtype: 'panel',
html: '<ul><li> Test </li></ul>'
}]
});
dwin.show()


Where's my bullet (from the unordered list)? The official API says "html fragment," does my complicated line of html not qualify?

fay
27 Mar 2010, 6:09 AM
You need to add preventBodyReset: true to the panel's config:


// ...
xtype: 'panel',
preventBodyReset: true,
html: '<ul><li> Test </li></ul>'
// ...

See: http://www.extjs.com/deploy/dev/docs/?class=Ext.Panel&member=preventBodyReset

aconran
27 Mar 2010, 3:56 PM
You are also overnesting your Windows and Panels. Instead of placing a panel within the Window, you can use the html configuration on the Window itself.

Alternatively you can place a layout of 'fit' on the Window to stretch the panel to fit 100% width and height (while accounting for the padding).