extjs中怎样为一个panel设置背景色???
1个回答
推荐于2017-09-26
展开全部
这个问题我知道!是这样设置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)
}]
});
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)
}]
});
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询