这对于普通用户来说可能非常简单,但作为一个新手,我有点难以执行
简单的算术运算,我想将其中一个列值(即(DealValue))乘以 0.05。我查看了剑道文档,但令人惊讶的是我找不到任何相关的东西。有人对此有任何解决方案吗?如果我运行此代码,我会在 DealValue 列的模板部分得到错误,导致网格不显示。
这是我的剑道网格列定义
columns: [
{
field: "DealIssuer",
width: 150,
title: "Issuer",
filterable: {
operators: {
string: {
startswith: "Starts With",
contains: "Contains"
}
}
},
template:"<a>${DealIssuer}</a>"
},
{
field: "Ticker",
width: 150,
title: "Ticker",
filterable: {
operators: {
string: {
startswith: "Starts With",
contains: "Contains"
}
}
}
},
{
field: "DealExchange",
width: 150,
title: "Exchange",
filterable: {
operators: {
string: {
startswith: "Starts With",
contains:"Contains"
}
}
}
},
{
field: "DealType",
width: 150,
title: "Type",
filterable: {
operators: {
string: {
startswith: "Starts With",
contains: "Contains"
}
}
}
},
{
field: "DealValue",
width: 150,
title: "Value ($)",
filterable: {
operators: {
string: {
startswith: "Starts With",
contains: "Contains"
}
}
},
template:'${${DealValue}*0.05}'
},
{
field: "DealStatus",
width: 150,
title: "Status",
filterable: {
operators: {
string: {
startswith: "Starts With",
contains: "Contains"
}
}
}
},
{
field: "DealPricingCompletionDate",
width: 230,
title: "DealPricingCompletionDate",
format: "{0:dd/MM/yyyy}",
// template: '#= kendo.toString(StartDate, "dd/MM/yyyy") #',
filterable: {
ui: "datetimepicker",
operators: {
date: {
gt: "After",
lt: "Before",
eq: "Equals"
},
messages: {
filter: "Apply",
clear: "Clear"
}
}
}
},
],