VSTS 扩展网格控件 header 样式
VSTS extensions Grid Control header style
制作我自己的 VSTS 扩展。扩展 returns 一个网格,其中包含项目中的错误列表以及对这些错误进行的一些计算。
我想给网格的 header 设置样式,使字体更大,背景不同。
我查看了 MS (https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/controls/grid) 的文档,他们提到了指定 HeaderCss class 的可能性。所以我做了以下事情:
- 我在 html header:
中创建了一个 CSS class
<head>
<style>
.mystyle {
background-color: coral;
color: white;
font-size: 25px;
}
</style>
<title>Weighted Defect Count Calculation</title>
<script src="sdk/scripts/VSS.SDK.js"></script>
</head>
我在 javascript 中添加了 class 名称,其中定义了网格列选项:
width: "100%",
height: "500px",
source: sourceArray,
columns: [
{ text: "ID", index: 0, width: 100, HeaderCss: { mystyle } },
{ text: "Title", index: 1, width: 200 },
{ text: "State", index: 2, width: 100 },
{ text: "Severity", index: 3, width: 200 },
{ text: "Likelihood", index: 4, width: 200 },
{ text: "Assigned To", index: 5, width: 300 },
]
我在 运行 扩展时收到 401 未授权错误。如果我删除了 HeaderCss 东西,那么它就可以正常工作了。
- 我试过 "mystyle"(双引号)。我收到语法错误
- 我尝试了 'mystyle'(使用单引号)。我收到语法错误
有人可以帮忙吗?
来自 MS 的文档:https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/controls/grid
我遵循的扩展教程在这里:http://nocture.dk/2016/01/02/lets-make-a-visual-studio-team-services-extension/
改用headerCss:"mystyle"
。 (第一个字符小写)。
另一方面,headerCss
的值是字符串而不是数组或对象。
制作我自己的 VSTS 扩展。扩展 returns 一个网格,其中包含项目中的错误列表以及对这些错误进行的一些计算。
我想给网格的 header 设置样式,使字体更大,背景不同。
我查看了 MS (https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/controls/grid) 的文档,他们提到了指定 HeaderCss class 的可能性。所以我做了以下事情: - 我在 html header:
中创建了一个 CSS class<head>
<style>
.mystyle {
background-color: coral;
color: white;
font-size: 25px;
}
</style>
<title>Weighted Defect Count Calculation</title>
<script src="sdk/scripts/VSS.SDK.js"></script>
</head>
我在 javascript 中添加了 class 名称,其中定义了网格列选项:
width: "100%",
height: "500px",
source: sourceArray,
columns: [
{ text: "ID", index: 0, width: 100, HeaderCss: { mystyle } },
{ text: "Title", index: 1, width: 200 },
{ text: "State", index: 2, width: 100 },
{ text: "Severity", index: 3, width: 200 },
{ text: "Likelihood", index: 4, width: 200 },
{ text: "Assigned To", index: 5, width: 300 },
]
我在 运行 扩展时收到 401 未授权错误。如果我删除了 HeaderCss 东西,那么它就可以正常工作了。
- 我试过 "mystyle"(双引号)。我收到语法错误
- 我尝试了 'mystyle'(使用单引号)。我收到语法错误
有人可以帮忙吗?
来自 MS 的文档:https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/controls/grid
我遵循的扩展教程在这里:http://nocture.dk/2016/01/02/lets-make-a-visual-studio-team-services-extension/
改用headerCss:"mystyle"
。 (第一个字符小写)。
另一方面,headerCss
的值是字符串而不是数组或对象。