gpt4 book ai didi

jquery - 在 Kendo Ui Grid 中为主行设置白色悬停背景并为 detailInit 行设置不同的悬停颜色

转载 作者:太空宇宙 更新时间:2023-11-04 09:44:45 25 4
gpt4 key购买 nike

enter image description here

我需要将主行的悬停背景设置为白色/透明,而将悬停在子网格中的行上设置为蓝色。

如何实现?我是 Kendo 网格和 css 的新手,所以仍然不太了解可以在此处应用的样式。

悬停时需要实现如下效果: enter image description here

请在下面找到我的代码:

var columns = [{ "Code": "COL1", "Description": "Item1" }, { "Code": "COL2", "Description": "Item2" }, { "Code": "COL3", "Description": "Item3" }];

var gridData = [{Code: "Code0",ColCode: "COL1",Description: "Desc 0",D5: 100,D3: 50,D4: 60,D1: 12345,D2: 1234},
{Code: "Code1",ColCode: "COL1",Description: "Desc 1",D5: 101,D3: 51,D4: 61,D1: 12346,D2: 1234},
{Code: "Code2",ColCode: "COL1",Description: "Desc 2",D5: 102,D3: 52,D4: 62,D1: 12347,D2: 1234},
{Code: "Code4",ColCode: "COL2",Description: "Desc 0",D5: 104,D3: 54,D4: 64,D1: 12349,D2: 1234},
{Code: "Code3",ColCode: "COL2",Description: "Desc 1",D5: 103,D3: 53,D4: 63,D1: 12348,D2: 1234},
{Code: "Code0",ColCode: "COL2",Description: "Desc 2",D5: 105,D3: 55,D4: 65,D1: 12350,D2: 1234},
{Code: "Code1",ColCode: "COL3",Description: "Desc 0",D5: 106,D3: 56,D4: 66,D1: 12351,D2: 1234},
{Code: "Code2",ColCode: "COL3",Description: "Desc 1",D5: 107,D3: 57,D4: 67,D1: 12352,D2: 1234},
{Code: "Code3",ColCode: "COL3",Description: "Desc 2",D5: 108,D3: 58,D4: 68,D1: 12353,D2: 1234},
];


$("#dataDiv").kendoGrid({
dataSource: columns,
columns: [
{ field: "Description", title: " " },
{ field: "D1", width : 110},
{ field: "D2", width: 110 },
{ field: "D3", width: 110 },
{ field: "D4", width: 110 },
{ field: "D5", width: 110 }
],
detailInit: detailInit,
dataBound: function () {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
resizable: false
});

function detailInit(e) {

var gridDataSource = new kendo.data.DataSource({
data: gridData,
type: "odata",
serverPaging: false,
serverSorting: false,
pageSize: 20,
filter: { field: "ColCode", operator: "eq", value: e.data.Code }
});


$("<div />").appendTo(e.detailCell).kendoGrid({
dataSource: gridDataSource,
scrollable: true,
sortable: true,
resizable: true,
columns: [
{ field: "Description", title: " " },
{ field: "D1", width : 110},
{ field: "D2", width: 110 },
{ field: "D3", width: 110 },
{ field: "D4", width: 110 },
{ field: "D5", width: 110 }
],
height : 180
});
}

最佳答案

你需要的CSS:

.k-master-row:hover {
background-color: transparent !important;
}
.k-detail-row .k-grid tbody tr:hover {
background-color: green !important;
}

A working example

关于jquery - 在 Kendo Ui Grid 中为主行设置白色悬停背景并为 detailInit 行设置不同的悬停颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39573229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com