根据列值将剑道网格中的一行灰化 [英] Gray out a row in kendo grid based on column value

查看:18
本文介绍了根据列值将剑道网格中的一行灰化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Kendo Grid,它的值是根据 post 调用填充的.如果其中一列的值为REGISTERED",我需要将整行灰显.

I have a Kendo Grid whose values get populated based on a post call. I need to gray out an entire row if one of the column has a value "REGISTERED".

有什么办法可以做到这一点吗?

Is there a way we can achieve this?

推荐答案

看这个例子,我检查每一行,看它是否符合条件,然后给它着色.你只需要像这样在网格的DataBound事件中添加这个事件

Look this example, I'm checking every row to see if it matches a condition, then colouring it. You just need to add this event in the DataBound event of the grid like this

.DataBound("onRowBound")

然后,检查条件

static onRowBound(e) {
   var grid = $("#Funciones").data("kendoGrid");
    grid.tbody.find('>tr').each(
        function () {
            var dataItem = grid.dataItem(this);
            if (dataItem.ColumnName == "REGISTERED") {
                $(this).css('background', 'gray');
            }
        });
}

这篇关于根据列值将剑道网格中的一行灰化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆