【发布时间】:2020-08-29 11:00:33
【问题描述】:
我正在尝试将背景颜色应用到 ExtJS 中的网格中的列,这里是我的代码,我应用了 sencha app watch,所以我加载了所有内容,但我一直没有应用任何栅栏,我是什么注意到了
Ext.define('Ris.academic.student.situation.SituationColumn', {
extend: 'Ext.grid.column.Column',
xtype: 'studentsituationcolumn',
text: 'Situaciones',
dataIndex: 'situations',
renderer(situations) {
let tags = [];
(situations || []).forEach(situation => {
tags.push(
`<div class="student-situation-tag" style="background-color: ${situation.color}">
${situation.text}
</div>`
);
});
return tags.join('');
}
});
这是 SCSS:
.x-grid-cell-inner {
.student-situation-tag {
display: flex;
font-size: smaller;
font-weight: bold;
color: #fff;
padding: 0 3pt;
border-radius: 3px;
text-align: center;
&:not(:first-child) {
margin-left: 2px;
}
}
}
.male-row .x-grid-cell {
background-color: lightblue; !important;
}
.female-row .x-grid-cell {
background-color: lightpink; !important;
}
【问题讨论】:
标签: javascript extjs sass grid background-color