Đây là giải pháp của tôi (nó hoạt động cho ExtJS 3.3.3):
Đối với nút bổ sung thêm lớp, tôi đặt tên nó là 'x-toolbar-grey- btn ':
xtype: 'button',
id: 'processButton',
text: 'Process',
ctCls: 'x-toolbar-grey-btn'
Styles cho các lớp học thêm, trong file CSS riêng biệt:
.x-toolbar-grey-btn .x-btn-tl{
background-position: 0 0;
}
.x-toolbar-grey-btn .x-btn-tr{
background-position: -3px 0;
}
.x-toolbar-grey-btn .x-btn-tc{
background-position: 0 -6px;
}
.x-toolbar-grey-btn .x-btn-ml{
background-position: 0 -24px;
}
.x-toolbar-grey-btn .x-btn-mr{
background-position: -3px -24px;
}
.x-toolbar-grey-btn .x-btn-mc{
background-position: 0 -1096px;
}
.x-toolbar-grey-btn .x-btn-bl{
background-position: 0 -3px;
}
.x-toolbar-grey-btn .x-btn-br{
background-position: -3px -3px;
}
.x-toolbar-grey-btn .x-btn-bc{
background-position: 0 -15px;
}
.x-toolbar-grey-btn button{
font-weight: bold;
}
Vì hình ảnh nút hình ảnh nằm trong tệp '/ext-3.3.3/resources/images/default/button/btn.gif', tôi chỉ thay đổi vị trí nền thuộc tính. Có vẻ như nút gốc.
Nguồn
2014-03-27 19:00:37
bạn có thể bao gồm mã hơn? Tôi đã thử điều này:}, { xtype: 'button', văn bản: 'asfasdf', ctCls: 'x-btn-over' } và nó không hoạt động –
không hoạt động với ExtJs 5, không được thử với ExtsJ 4 – Skrol29