admin管理员组文章数量:1125723
I wish to make statusbar background color same with window panel background color using css.
what I found
.x-toolbar{
background-image: url(image/toolbar.gif);
}
i use snapshot of the panel background and save as gif . it work but is this the correct way to do?
I wish to make statusbar background color same with window panel background color using css.
what I found
.x-toolbar{
background-image: url(image/toolbar.gif);
}
i use snapshot of the panel background and save as gif . it work but is this the correct way to do?
Share Improve this question asked Jan 9 at 3:58 Charles CandyCharles Candy 111 bronze badge 1- Hi, if you are satisfied with an answer, please remember to choose the best answer. I saw that you posted another questions and did not mark any answer. (extjs listeners sub component event) – Dinkheller Commented 2 days ago
2 Answers
Reset to default 1You can set a background color without CSS like this (you can run this in a Sencha Fiddle):
Ext.application({
name: 'Fiddle',
launch: function () {
Ext.create('Ext.panel.Panel', {
title: 'Panel',
height: 200,
dockedItems: [{
xtype: 'toolbar',
style: {
backgroundColor: 'red'
},
items: [{
xtype: "button",
text: 'Button'
}]
}],
items: [{
xtype: 'component',
html: 'Hello world!'
}],
renderTo: Ext.getBody()
});
}
});
If you prefer CSS, define a custom style:
.my-style {
background-color: yellow;
}
Set this CSS style like this:
Ext.application({
name: 'Fiddle',
launch: function () {
Ext.create('Ext.panel.Panel', {
title: 'Panel',
height: 200,
dockedItems: [{
xtype: 'toolbar',
userCls: 'my-style',
items: [{
xtype: "button",
text: 'Button'
}]
}],
items: [{
xtype: 'component',
html: 'Hello world!'
}],
renderTo: Ext.getBody()
});
}
});
I would go with transparent for the toolbar, if you want to keep the background image visible.
- if you send an additional image, less data to transfer
- will always stay in place
@example
// ExtJS
xtype: 'toolbar',
cls : 'transparent'
// css
.x-toolbar.transparent {
background-image: transparent;
}
or
xtype: 'toolbar',
style: {
backgroundColor: 'transparent'
}
本文标签: EXTJS changing statusbar background colorStack Overflow
版权声明:本文标题:EXTJS changing statusbar background color - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736673537a1947052.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论