javascript - Angular devextreme 风格的 dxi 列
问题描述
我需要在 Datagrid 中创建一列以获得指针光标,但任何样式都不会改变一切。我试过使用 dxi-column 选择器并使用一个类。与 和without::ng-deep
。
有什么想法或解决方案吗?
<dxi-column dataField="companyDetails.name" caption="Company">
</dxi-column>
我已经开始使用模板,但我无法让包装器填写单元格
::ng-deep .dx-template-wrapper {
cursor: pointer;
}
解决方案
看看 的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
}
}
希望这足够清楚。:)
推荐阅读
- java - 两个 DateTime 对象之间的差异(以分钟为单位)
- vue.js - Vue 语法错误:Unexpected Token
- java - 我的 outputStream 声明出现 VariableDeclaratorID 预期异常
- reactjs - 如何在不同的 URL 路由之间保存 redux 状态?
- java - 将原始文本添加到 SOAP 标头
- c - 找到时无法返回树节点
- javascript - 如果 setAttribute() 是定义的变量,它不会“记住”函数中分配给它的 ID 的值吗?
- https - 带有letsencrypt的KeystoneJS - 需要证书文件
- netlify - 是否可以在 netlify.toml 文件中设置 access_token ?
- java - 从 Eclipse Oxygen 到 Wildfly 12 的 EAR 部署