【问题标题】:Set Editable False for some Rows in Kendo grid为 Kendo 网格中的某些行设置 Editable False
【发布时间】:2013-09-24 05:36:16
【问题描述】:

我想为剑道网格中的某些行(不是全部)设置可编辑的 false。我该怎么做 ? 有没有办法从外部设置网格行属性。 当网格行数据绑定时,我将捕获行。但我不知道将行可编辑设置为 false。

function GridOnDataBound(arg) {
    dataView = this.dataSource.view();
    var grid = $("#grid").data("kendoGrid");

    var rowObjs = grid.tbody[0].rows;

    for (var i = 0; i < dataView.length; i++) {
        var row = rowObjs[i];
        //            row.className = "gridWhiteRow";
        if (dataView[i].AprPrtyKy === 8941) {//low
            //                row.className = "gridGreenRow";
        }
        if (dataView[i].AprPrtyKy === 8940) {//hight
            //                row.className = "gridYellowRow";
        }
        if (dataView[i].AprPrtyKy === 8944) {//urgent
            row.className = "gridRedRow";
        }
        if (dataView[i].AprPrtyKy === 8942) {//normal
            //                row.className = "gridAquaRow";
        }
        if (dataView[i].AprPrtyKy === 8945) {//normal
            //                row.className = "gridPurpleRow";
        }
        if (dataView[i].AprStsKy === 8946) {
            row.className = "gridGreenRow";
        }

    }
}

请帮忙。谢谢 ! :)

【问题讨论】:

  • 您使用的是哪种版本模式(内联、内联、弹出)?基本上,没有开箱即用的方式来控制它,但根据您的版本模式,有一些简单的解决方案可能对您有用。

标签: javascript jquery jquery-ui kendo-ui kendo-grid


【解决方案1】:

您可以使用与 this code library article 中介绍的方法相同的方法来使行不可点击(点击 + stopPropagation)。

【讨论】:

    猜你喜欢
    • 2023-03-24
    • 2013-08-10
    • 2014-01-03
    • 2012-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 2012-11-07
    相关资源
    最近更新 更多