简体   繁体   English

将所选行颜色添加到备用kendo网格CSS

[英]Adding selected row color to alternate kendo grid CSS

I have a kendo grid and it contains rows of different colors. 我有一个剑道网格,它包含不同颜色的行。 I am trying to add row selected color to alternate rows like 1,3,5,7.... since the rows 2,4,6,8... selected color works fine, but when alternate row is selected it wont display the selected color, i believe I might have left something couldn't able to find, please let me know what I am missing 我试图将行选择的颜色添加到交替的行,如1,3,5,7 ....因为行2,4,6,8 ...选择的颜色工作正常,但当选择交替行时它不会显示选择的颜色,我相信我可能留下了一些无法找到的东西,请让我知道我错过了什么

CSS CODE CSS代码

This is the css for all rows 这是所有行的CSS

.k-grid-content > table > tbody > tr 
{
background:rgba(63,193,192, 0.1);
/*opacity:0.8;*/
filter:Alpha(opacity=50); /* IE8 and earlier */
border:1px solid white;
color:#494949;   

cursor:pointer;
transition:color 1s ease;
transition:background 1s ease; 
}

This CSS for alternate Row 这个替代行的CSS

.k-grid-content>table>tbody>.k-alt
{
   background:rgba(63,193,192, 0.2);   
    filter:Alpha(opacity=50); /* IE8 and earlier */    
}

This is for selected rows(where it works only for alternate row) 这适用于选定的行(仅适用于备用行)

.k-grid table tr.k-state-selected
{
background: #22B99F;

 }

Below is the image describing the question 下面是描述问题的图像 在此输入图像描述

Here is the example by assuming your issue 以下是假设您的问题的示例

The issue is with your css file. 问题出在您的css文件中。 The alternate rows does not work because (i think) that you have written 备用行不起作用,因为(我认为)你写的

.k-grid table tr.k-state-selected
{
    background: #22B99F;
}

.k-grid-content>table>tbody>.k-alt
{
   background:rgba(63,193,192, 0.2);   
   filter:Alpha(opacity=50); /* IE8 and earlier */    
}

Here the styles for alternate rows will override the style of the selected rows, so instead try to specify the selected row's color after .k-grid-content>table>tbody>.k-alt that is 这里备用行的样式将覆盖所选行的样式,因此请尝试在.k-grid-content>table>tbody>.k-alt之后指定所选行的颜色。

.k-grid-content>table>tbody>.k-alt
{
   background:rgba(63,193,192, 0.2);   
   filter:Alpha(opacity=50); /* IE8 and earlier */    
}

.k-grid table tr.k-state-selected
{
    background: #22B99F;
}

Here is the solution 这是解决方案

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

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