PDA

View Full Version : How can i let the title of accordion center?



chenzhaoplus
2 May 2012, 11:48 PM
hey guys,my code is:


Ext.define('MyApp.views.FoodMisWestPanel', {
extend : 'Ext.panel.Panel',
region : 'west',
title : 'menu',
width : 200,
minWidth : 175,
maxWidth : 400,
collapsible : true,
animCollapse : true,
split : true,
layout : 'accordion',
defaults : {
bodyStyle : 'padding:15px'// applied to each contained panel
},


initComponent : function() {
this.items = this.buildItems();
this.callParent();
},
buildItems : function() {
return [{
title : 'general info',
layout : {
align : 'center',
type : 'vbox',
pack : 'start'
}
}];
}
}


How can i let general info center?

scottmartin
3 May 2012, 8:17 AM
Please try the following:


.x-accordion-hd .x-panel-header-text-container {
text-align:center !important;
}


Regards,
Scott.

chenzhaoplus
3 May 2012, 10:51 PM
Please try the following:
.x-accordion-hd .x-panel-header-text-container { text-align:center !important;}Regards,Scott. it donesn't work.

scottmartin
4 May 2012, 3:05 AM
Did you create a CSS file and include it after the ext-all.css in you html file?

Here is a quick test at jsFiddle:

34893

Scott.