Javascript 如何在ExtJs中将标题项向右对齐
这是我的标题和它的项目;如您所见,我尝试添加了Javascript 如何在ExtJs中将标题项向右对齐,javascript,extjs,Javascript,Extjs,这是我的标题和它的项目;如您所见,我尝试添加了样式属性,但没有任何帮助-链接仍然向左对齐,而我希望它向右对齐: items: [ { region: 'north', xtype: 'header', items:[ { xtype: 'component', autoEl: { html: '<a href="#">View All Services</a&
样式
属性,但没有任何帮助-链接仍然向左对齐,而我希望它向右对齐:
items: [
{
region: 'north',
xtype: 'header',
items:[
{
xtype: 'component',
autoEl: {
html: '<a href="#">View All Services</a>'
},
style: {
textAlign: 'right',
left: 'auto',
right: '0'
},
listeners: {
render: function(component) {
component.getEl().on('click', function(e) {
alert('test');
});
}
}
}
],
padding: 6
}
项目:[
{
地区:'北',
xtype:'标题',
项目:[
{
xtype:'组件',
autoEl:{
html:'
},
风格:{
textAlign:'右',
左:“自动”,
右:“0”
},
听众:{
渲染:函数(组件){
在('click',函数(e)上的component.getEl(){
警报(“测试”);
});
}
}
}
],
填充:6
}
如何将标题中的项目向右对齐?将标题
标题位置配置属性设置为0
。默认情况下,标题组件中的项目添加到标题标题前。如果将标题位置配置设置为0
,则项目将添加到标题后:
items: [
{
region: 'north',
xtype: 'header',
titlePosition: 0,
items:[
{
xtype: 'component',
autoEl: {
html: '<a href="#">View All Services</a>'
},
listeners: {
render: function(component) {
component.getEl().on('click', function(e) {
alert('test');
});
}
}
}
],
padding: 6
}
项目:[
{
地区:'北',
xtype:'标题',
标题位置:0,
项目:[
{
xtype:'组件',
autoEl:{
html:'
},
听众:{
渲染:函数(组件){
在('click',函数(e)上的component.getEl(){
警报(“测试”);
});
}
}
}
],
填充:6
}
谢谢,我本来想试试的,但是我在