gpt4 book ai didi

javascript - Kendo UI 网格单元格背景色

转载 作者:搜寻专家 更新时间:2023-11-01 05:11:46 25 4
gpt4 key购买 nike

在 kendo ui grid 中如何更改背景颜色?我试图为列设置模板,但是当网格可视化时,它是空的,没有任何颜色。我有这段代码:

$scope.thingsOptions = {
sortable: "true",
scrollable: "true",
columns: [
{ field: "Colore", title: "Colore", width: "160px", template: "<div><span style='background-color:red'></span></div>" }
]

};

如何应用模板为单元格背景着色

最佳答案

如何添加条件单元格背景?

它的作用是:如果没有给定行模板,它会根据所有参数构建一个文本行模板。可以在大多数参数中添加模板文本,例如:

...
//},
columns : [
{
title : 'Questions Translated',
attributes:{ 'style':"#=questions!==questionsMax?'background-color: red; color:white;':''#" },
field : "questions",
width: 140
},

...

关于javascript - Kendo UI 网格单元格背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23871709/

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