看看 的cssClass属性column。
这是它的文档
就像是:
组件.ts
<dxi-column dataField="companyDetails.name" caption="Company" cssClass="pointer-column">
</dxi-column>
组件.scss
::ng-deep pointer-column {
cursor: pointer;
}
或者,如果您希望此类全局应用于所有网格,您可以将其添加到style.scss文件中而无需任何::ng-deep需要。或者更好的是,你可以只通过给它们一个类来让它们对某些网格全局化:
任何组件.ts
<dx-data-grid
...
class="a-type-of-grid">
</dx-data-grid>
样式.css
//anything with this class
.pointer-column {
cursor: pointer;
}
//grids (or other elements if you want) with the 'a-type-of-grid' class
.a-type-of-grid {
/*Some css just for this type of grid*/
//overwrite the global pointer-column class
.pointer-column {
//css you want
}
}
希望这足够清楚。:)