extjs中怎样为一个panel设置背景色???

2024-12-18 19:52:25
推荐回答(1个)
回答1:

这个问题我知道!是这样设置bodyStyle:'background:#ffc;padding:10px;',
varresultsPanel=Ext.create('Ext.panel.Panel',{
title:'Results',
width:600,
height:400,
renderTo:Ext.getBody(),
bodyStyle:'background:#ffc;padding:10px;',
layout:{
type:'vbox',//Arrangechilditemsvertically
align:'stretch',//Eachtakesupfullwidth
padding:5
},
items:[{//Resultsgridspecifiedasaconfigobjectwithanxtypeof'grid'
xtype:'grid',
columns:[{header:'ColumnOne'}],//Oneheaderjustforshow.There'snodata,
store:Ext.create('Ext.data.ArrayStore',{}),//Adummyemptydatastore
flex:1//Use1/3ofContainer'sheight(hinttoBoxlayout)
},{
xtype:'splitter'//Asplitterbetweenthetwochilditems
},{//DetailsPanelspecifiedasaconfigobject(noxtypedefaultsto'panel').
title:'Details',
bodyPadding:10,
items:[{
fieldLabel:'Dataitem',
xtype:'textfield'
}],//Anarrayofformfields
flex:2//Use2/3ofContainer'sheight(hinttoBoxlayout)
}]
});