简体   繁体   English

如何根据条件更改 slickgrid header 背景颜色?

[英]How can i change slickgrid header background color based on a condition?

I am using a angular-slickgrid = 2.30.2,Angular 10, i am using styles.css where i am loading the slickgrid theme through bootstrap.sass file. I am using a angular-slickgrid = 2.30.2,Angular 10, i am using styles.css where i am loading the slickgrid theme through bootstrap.sass file. i have created a shared slickgrid component and using it in parent components wherever required.我创建了一个共享的 slickgrid 组件,并在需要时在父组件中使用它。

  1. i want to change the slick grid header color based on a condition in my parent component.我想根据父组件中的条件更改光滑网格 header 颜色。 For eg if my variable value is true then show slickgrid header blue else red, how can i do that?例如,如果我的变量值为真,则显示 slickgrid header 蓝色否则为红色,我该怎么做?
  1. i want to add bottom border for every third row in grid for only one screen/component which is using slick grid, how can I implement that.我想为网格中的每第三行添加一个底部边框,只为一个使用光滑网格的屏幕/组件,我该如何实现。

i am new to slickgrid, please guide.我是 slickgrid 的新手,请指导。

Please note that I'm the author of Angular-Slickgrid, there are already plenty of SO questions and answers on how to style SlickGrid, take for example these:请注意,我是 Angular-Slickgrid 的作者,已经有很多关于如何设置 SlickGrid 样式的问题和答案,例如:

and/or simply use the Column properties cssClass or headerCssClass from the Column interface.和/或简单地使用Column接口中的 Column 属性cssClassheaderCssClass I added TypeScript types for everything in latest version which should give you enough indication of what you can try.我为最新版本中的所有内容添加了 TypeScript 类型,这应该给你足够的指示,你可以尝试什么。

Also please remember that Angular-Slickgrid is a wrapper of SlickGrid, searching for SlickGrid will always provide you more result to your question searches另请记住,Angular-Slickgrid 是 SlickGrid 的包装器,搜索 SlickGrid 将始终为您的问题搜索提供更多结果

Lastly you're on an older version (2.x) that I no longer support, you should think about migrating eventually to get access to newer features and smaller builds, see Migration Guide 3.x and Migration Guide 4.x最后,您使用的是我不再支持的旧版本 (2.x),您应该考虑最终迁移以访问更新的功能和更小的版本,请参阅迁移指南 3.x迁移指南 4.x

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM