以彩色行显示细节:js,telerik,

时间:2018-06-12 06:54:09

标签: javascript telerik

当它混合一行的颜色时,我无法扩展该行的细节。 如果单元格[0]未着色,则细节会正确显示。 我需要更改行中所有单元格的颜色。包括单元格[0]

下面的照片: https://zapodaj.net/3fca8e0f5221a.jpg.html enter image description here

我的代码(带颜色的行):

    function SelectedSolutionRowDataBound(e) {
            var grid = $("#CuttingOptimalizationResultGrid").data("kendoGrid");
            var gridData = grid.dataSource.view();

            for (var i = 0; i < gridData.length; i++) {
                var currentUid = gridData[i].uid;
                var currenRow = grid.table.find("tr[data-uid='" + currentUid + "']");

                if (gridData[i].IsDefaultSolution == 1) {
                    if (i % 2 == 0) {
                        currenRow[0].cells[0].className = "SelectedSolution";
                        currenRow[0].cells[1].className = "SelectedSolution";
                        currenRow[0].cells[2].className = "SelectedSolution";
                        currenRow[0].cells[3].className = "SelectedSolution";
                        currenRow[0].cells[4].className = "SelectedSolution";
                        currenRow[0].cells[5].className = "SelectedSolution";
                        currenRow[0].cells[6].className = "SelectedSolution";
                        currenRow[0].cells[7].className = "SelectedSolution";
                        currenRow[0].cells[8].className = "SelectedSolution";
                        currenRow[0].cells[9].className = "SelectedSolution";
                        currenRow[0].cells[10].className ="SelectedSolution";
                        currenRow[0].cells[11].className ="SelectedSolution";
                        currenRow[0].cells[12].className ="SelectedSolution";
                        currenRow[0].cells[13].className = "SelectedSolution";
                        currenRow[0].cells[14].className = "SelectedSolution";
                    }
                    else {
                        currenRow[0].cells[0].className = "SelectedSolution2";
                        currenRow[0].cells[1].className = "SelectedSolution2";
                        currenRow[0].cells[2].className = "SelectedSolution2";
                        currenRow[0].cells[3].className = "SelectedSolution2";
                        currenRow[0].cells[4].className = "SelectedSolution2";
                        currenRow[0].cells[5].className = "SelectedSolution2";
                        currenRow[0].cells[6].className = "SelectedSolution2";
                        currenRow[0].cells[7].className = "SelectedSolution2";
                        currenRow[0].cells[8].className = "SelectedSolution2";
                        currenRow[0].cells[9].className = "SelectedSolution2";
                        currenRow[0].cells[10].className = "SelectedSolution2";
                        currenRow[0].cells[11].className = "SelectedSolution2";
                        currenRow[0].cells[12].className = "SelectedSolution2";
                        currenRow[0].cells[13].className = "SelectedSolution2";
                        currenRow[0].cells[14].className = "SelectedSolution2";
                    }

                }
            }
        }

(我的代码显示详细信息)

<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().TabStrip()
                .Name("tabStrip_#=SolutionId#")
                .SelectedIndex(0)
                .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
                .Items(items =>
                {
                    items.Add().Text(@PE.HMIWWW.Core.Resources.VM_Resources.GLOB_Name_Details).LoadContentFrom(Url.Action("Details", "CutOptimization", new { Id = "#=SolutionId#" }));
                })

                .ToClientTemplate())

0 个答案:

没有答案